Another place we cant use readline on macOS

This commit is contained in:
Kovid Goyal 2022-08-30 19:27:55 +05:30
parent 30e1b4680d
commit 78056c659c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 10 additions and 2 deletions

View File

@ -273,9 +273,9 @@ def save_as(conn_data: SSHConnectionData, remote_path: str, cli_opts: RemoteFile
) )
print('Relative paths will be resolved from:', styled(os.getcwd(), fg_intense=True, bold=True)) print('Relative paths will be resolved from:', styled(os.getcwd(), fg_intense=True, bold=True))
print() print()
from ..tui.path_completer import PathCompleter from ..tui.path_completer import get_path
try: try:
dest = PathCompleter().input() dest = get_path()
except (KeyboardInterrupt, EOFError): except (KeyboardInterrupt, EOFError):
return return
if dest: if dest:

View File

@ -3,6 +3,7 @@
import os import os
import sys
from typing import Any, Callable, Dict, Generator, Optional, Sequence, Tuple from typing import Any, Callable, Dict, Generator, Optional, Sequence, Tuple
from kitty.fast_data_types import wcswidth from kitty.fast_data_types import wcswidth
@ -147,5 +148,12 @@ class PathCompleter:
return '' return ''
def get_path(prompt: str = '> ') -> str:
rd = getattr(sys, 'kitty_run_data')
if 'prewarmed' in rd and 'launched_by_launch_services' in rd:
return input(prompt)
return PathCompleter(prompt).input()
def develop() -> None: def develop() -> None:
PathCompleter().input() PathCompleter().input()