Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion kitty-convert-dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ def env_to_str(env):
def cmdline_to_str(cmdline):
"""Convert a cmdline list to a space separated string."""
s = ""
for e in cmdline:
for i, e in enumerate(cmdline):
# Login shells have argv[0] starting with '-' (e.g. '-fish', '-bash').
# Kitty's session parser interprets this as a flag, producing
# "Unknown flag: -f". Strip the leading '-' to produce valid output.
if i == 0 and e.startswith('-') and len(e) > 1:
e = e[1:]
s += f"{e} "

return s.strip()
Expand Down