mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 19:21:38 +02:00
goto_session -1 should not fail when no session history is present
This commit is contained in:
@@ -458,8 +458,13 @@ def goto_session(boss: BossType, cmdline: Sequence[str]) -> None:
|
|||||||
except Exception:
|
except Exception:
|
||||||
idx = 0
|
idx = 0
|
||||||
if idx < 0:
|
if idx < 0:
|
||||||
nidx = max(0, len(goto_session_history) - 1 - idx)
|
if boss.active_session:
|
||||||
switch_to_session(boss, goto_session_history[nidx])
|
nidx = max(0, len(goto_session_history) - 1 - idx)
|
||||||
|
if nidx < len(goto_session_history):
|
||||||
|
switch_to_session(boss, goto_session_history[nidx])
|
||||||
|
else:
|
||||||
|
if goto_session_history:
|
||||||
|
switch_to_session(boss, goto_session_history[-1])
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
for x in cmdline:
|
for x in cmdline:
|
||||||
|
|||||||
Reference in New Issue
Block a user