Fix reading session from STDIN not working when used with --single-instance
Fixes #4155
This commit is contained in:
parent
1251f9ec80
commit
21830048c9
@ -468,6 +468,9 @@ class Boss:
|
||||
args, rest = parse_args(data['args'][1:], result_class=CLIOptions)
|
||||
args.args = rest
|
||||
opts = create_opts(args)
|
||||
if args.session == '-':
|
||||
from .session import PreReadSession
|
||||
args.session = PreReadSession(data['stdin'])
|
||||
if not os.path.isabs(args.directory):
|
||||
args.directory = os.path.join(data['cwd'], args.directory)
|
||||
for session in create_sessions(opts, args, respect_cwd=True):
|
||||
|
||||
@ -56,9 +56,12 @@ def set_custom_ibeam_cursor() -> None:
|
||||
def talk_to_instance(args: CLIOptions) -> None:
|
||||
import json
|
||||
import socket
|
||||
stdin = ''
|
||||
if args.session == '-':
|
||||
stdin = sys.stdin.read()
|
||||
data = {'cmd': 'new_instance', 'args': tuple(sys.argv),
|
||||
'startup_id': os.environ.get('DESKTOP_STARTUP_ID'),
|
||||
'cwd': os.getcwd()}
|
||||
'cwd': os.getcwd(), 'stdin': stdin}
|
||||
notify_socket = None
|
||||
if args.wait_for_single_instance_window_close:
|
||||
address = f'\0{appname}-os-window-close-notify-{os.getpid()}-{os.geteuid()}'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user