mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-12 11:39:33 +02:00
Mark output before running command
This will help with shell integration erasing the prompt if there is a resize caused by the command
This commit is contained in:
@@ -143,7 +143,7 @@ def print_help(which: Optional[str] = None) -> None:
|
||||
|
||||
def run_cmd(global_opts: RCOptions, cmd: str, func: RemoteCommand, opts: Any, items: List[str]) -> None:
|
||||
from .remote_control import do_io
|
||||
print(end=set_window_title(cmd), flush=True)
|
||||
print(end=set_window_title(cmd) + output_prefix, flush=True)
|
||||
payload = func.message_to_kitty(global_opts, opts, items)
|
||||
send = {
|
||||
'cmd': cmd,
|
||||
@@ -154,13 +154,11 @@ def run_cmd(global_opts: RCOptions, cmd: str, func: RemoteCommand, opts: Any, it
|
||||
send['payload'] = payload
|
||||
response = do_io(global_opts.to, send, func.no_response)
|
||||
if not response.get('ok'):
|
||||
print(end=output_prefix, flush=True)
|
||||
if response.get('tb'):
|
||||
print_err(response['tb'])
|
||||
print_err(response['error'])
|
||||
return
|
||||
if 'data' in response:
|
||||
print(end=output_prefix, flush=True)
|
||||
print(response['data'])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user