mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 16:34:47 +01:00
little passthrough to use BaseShell directly
This commit is contained in:
parent
1e5eab8f5a
commit
e928423dbb
1 changed files with 7 additions and 7 deletions
|
@ -88,23 +88,23 @@ class Shell(object):
|
|||
warn('prompt_toolkit is not available, using readline instead.')
|
||||
shell_type = env['SHELL_TYPE'] = 'readline'
|
||||
# actually make the shell
|
||||
if shell_type == 'prompt_toolkit':
|
||||
if shell_type == 'none':
|
||||
from xonsh.base_shell import BaseShell as cls
|
||||
elif shell_type == 'prompt_toolkit':
|
||||
vptk = prompt_toolkit_version()
|
||||
minor = int(vptk.split('.')[1])
|
||||
if minor < 57 or vptk == '<0.57': # TODO: remove in future
|
||||
msg = ('prompt-toolkit version < v0.57 and may not work as '
|
||||
'expected. Please update.')
|
||||
warn(msg, RuntimeWarning)
|
||||
from xonsh.ptk.shell import PromptToolkitShell
|
||||
self.shell = PromptToolkitShell(execer=self.execer,
|
||||
ctx=self.ctx, **kwargs)
|
||||
from xonsh.ptk.shell import PromptToolkitShell as cls
|
||||
elif shell_type == 'readline':
|
||||
from xonsh.readline_shell import ReadlineShell
|
||||
self.shell = ReadlineShell(execer=self.execer,
|
||||
ctx=self.ctx, **kwargs)
|
||||
from xonsh.readline_shell import ReadlineShell as cls
|
||||
else:
|
||||
raise XonshError('{} is not recognized as a shell type'.format(
|
||||
shell_type))
|
||||
self.shell = cls(execer=self.execer,
|
||||
ctx=self.ctx, **kwargs)
|
||||
# allows history garbace colector to start running
|
||||
builtins.__xonsh_history__.gc.wait_for_shell = False
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue