This commit is contained in:
Kovid Goyal 2021-08-21 17:32:55 +05:30
parent d2a31a6a0f
commit 7f1c5d8534
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 3 deletions

View File

@ -160,7 +160,7 @@ def main(args: List[str]) -> Response:
import readline as rl
readline = rl
from kitty.shell import init_readline
init_readline(readline)
init_readline()
response = None
with alternate_screen(), HistoryCompleter(cli_opts.name):

View File

@ -30,7 +30,8 @@ def match_commands() -> Tuple[str, ...]:
return tuple(sorted(all_commands + ('exit', 'help', 'quit')))
def init_readline(readline: Any) -> None:
@run_once
def init_readline() -> None:
with suppress(OSError):
readline.read_init_file()
if 'libedit' in readline.__doc__:
@ -155,7 +156,7 @@ def run_cmd(global_opts: RCOptions, cmd: str, func: RemoteCommand, opts: Any, it
def real_main(global_opts: RCOptions) -> None:
init_readline(readline)
init_readline()
print_help_for_seq.allow_pager = False
print('Welcome to the kitty shell!')
print('Use {} for assistance or {} to quit'.format(green('help'), green('exit')))