mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-10 07:59:24 +02:00
Ring bell when goto_session -1 has no history
This commit is contained in:
@@ -13,7 +13,7 @@ from typing import TYPE_CHECKING, Any, Optional, Sequence, Union
|
||||
|
||||
from .cli_stub import CLIOptions, SaveAsSessionOptions
|
||||
from .constants import config_dir, unserialize_launch_flag
|
||||
from .fast_data_types import get_options
|
||||
from .fast_data_types import get_options, ring_bell
|
||||
from .layout.interface import all_layouts
|
||||
from .options.types import Options
|
||||
from .options.utils import resize_window, to_layout_names, window_size
|
||||
@@ -462,9 +462,13 @@ def goto_session(boss: BossType, cmdline: Sequence[str]) -> None:
|
||||
nidx = max(0, len(goto_session_history) - 1 - idx)
|
||||
if nidx < len(goto_session_history):
|
||||
switch_to_session(boss, goto_session_history[nidx])
|
||||
return
|
||||
else:
|
||||
if goto_session_history:
|
||||
switch_to_session(boss, goto_session_history[-1])
|
||||
return
|
||||
if get_options().enable_audio_bell:
|
||||
ring_bell(getattr(boss.active_tab_manager, 'os_window_id', 0))
|
||||
return
|
||||
else:
|
||||
for x in cmdline:
|
||||
|
||||
Reference in New Issue
Block a user