Another place we cant use readline on macOS
This commit is contained in:
parent
30e1b4680d
commit
78056c659c
@ -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:
|
||||||
|
|||||||
@ -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()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user