mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 10:41:58 +02:00
Fix #8558
This commit is contained in:
@@ -31,6 +31,7 @@ from kitty.fast_data_types import (
|
|||||||
from kitty.os_window_size import WindowSizeData, edge_spacing
|
from kitty.os_window_size import WindowSizeData, edge_spacing
|
||||||
from kitty.types import LayerShellConfig
|
from kitty.types import LayerShellConfig
|
||||||
from kitty.typing import BossType, EdgeLiteral
|
from kitty.typing import BossType, EdgeLiteral
|
||||||
|
from kitty.utils import log_error
|
||||||
|
|
||||||
OPTIONS = r'''
|
OPTIONS = r'''
|
||||||
--lines
|
--lines
|
||||||
@@ -302,7 +303,11 @@ def layer_shell_config(opts: PanelCLIOptions) -> LayerShellConfig:
|
|||||||
|
|
||||||
def handle_single_instance_command(boss: BossType, sys_args: Sequence[str], environ: Mapping[str, str], notify_on_os_window_death: str | None = '') -> None:
|
def handle_single_instance_command(boss: BossType, sys_args: Sequence[str], environ: Mapping[str, str], notify_on_os_window_death: str | None = '') -> None:
|
||||||
from kitty.tabs import SpecialWindow
|
from kitty.tabs import SpecialWindow
|
||||||
args, items = parse_panel_args(list(sys_args[1:]))
|
try:
|
||||||
|
args, items = parse_panel_args(list(sys_args[1:]))
|
||||||
|
except BaseException as e:
|
||||||
|
log_error(f'Invalid arguments received over single instance socket: {sys_args} with error: {e}')
|
||||||
|
return
|
||||||
if args.toggle_visibility and boss.os_window_map:
|
if args.toggle_visibility and boss.os_window_map:
|
||||||
for os_window_id in boss.os_window_map:
|
for os_window_id in boss.os_window_map:
|
||||||
toggle_os_window_visibility(os_window_id)
|
toggle_os_window_visibility(os_window_id)
|
||||||
|
|||||||
@@ -848,7 +848,12 @@ class Boss:
|
|||||||
from .cli_stub import CLIOptions
|
from .cli_stub import CLIOptions
|
||||||
startup_id = data['environ'].get('DESKTOP_STARTUP_ID', '')
|
startup_id = data['environ'].get('DESKTOP_STARTUP_ID', '')
|
||||||
activation_token = data['environ'].get('XDG_ACTIVATION_TOKEN', '')
|
activation_token = data['environ'].get('XDG_ACTIVATION_TOKEN', '')
|
||||||
args, rest = parse_args(list(data['args'][1:]), result_class=CLIOptions)
|
try:
|
||||||
|
args, rest = parse_args(list(data['args'][1:]), result_class=CLIOptions)
|
||||||
|
except BaseException as e:
|
||||||
|
self.show_error(_('Invalid single instance command received'), _('The command: {0} is invalid with error: {1}').format(
|
||||||
|
data['args'], e))
|
||||||
|
return None
|
||||||
cmdline_args_for_open = data.get('cmdline_args_for_open')
|
cmdline_args_for_open = data.get('cmdline_args_for_open')
|
||||||
if cmdline_args_for_open:
|
if cmdline_args_for_open:
|
||||||
self.launch_urls(*cmdline_args_for_open, no_replace_window=True)
|
self.launch_urls(*cmdline_args_for_open, no_replace_window=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user