You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's this macOS feature that adds semantic title bars. Terminal.app supports it through documented OSC escape sequences. It's really cool because an icon and a path (interpreted as such, and not just as a generic "title" string) is displayed by the OS, which is right-clickable to pop up the whole path, and clicking on any folder opens it in Finder right away.
As for the generic title string, there's also a distinction between tab title and window title.
In Kitty, implementing support for these escape sequences could enable additional placeholders for tab_title_template, such as {wd} and {document} in addition to the generic {title}. This would also make it possibly queryable as a property from kitty remote thus enabling clever scripting, and possibly, who, knows, help in someday implementing restoring windows cd'd into their initial directory.
Describe alternatives you've considered
Parsing the title string back, but it's error-prone, brittle, and kind of ludicrous
Use Terminal instead of Kitty ;)
Additional context
The inline doc for the sequences in Apple's Terminal:
The UI leveraging this metadata in action (notice the change in icons):
Shell code that get called on working directory changes to set the "working directory" metadata, as well as the "window title" string (both get displayed independently in my current Terminal configuration, see example above):
set_term_title() {
[[ -o interactive ]] ||return# Bubble information up to the terminalcase$TERM_PROGRAMin
Apple_Terminal)
local SEARCH=''local REPLACE='%20'local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"printf'\e]7;%s\a'"$PWD_URL"
;;
*)
# NOOP
;;
esaccase$TERMin
screen*)
#print -Pn "\ek%n@%m: %~\e\\" #breaks tmux
print -Pn "\e]2;%n@%m: %~\a"
;;
xterm*|*rxvt*)
print -Pn "\e]2;%n@%m: %~\a"
;;
*)
# NOOP
;;
esac
}
Not a big fan of OS specific things, and if I ever want to open a finder
window in the current working directory of the active window, I'd just
create a mapping for it in kitty.conf rather than clicking with the
mouse using https://sw.kovidgoyal.net/kitty/launch.html
That said I wont refuse PR for it. Patches are most welcome. If you need
guidance with kitty's codebase, feel free to post on this thread and I
will help. You can get started with building kitty as described here: https://sw.kovidgoyal.net/kitty/build.html
Closing this bug report, if anyone wishes to implemet it, feel free to
comment further.
Describe the solution you'd like
There's this macOS feature that adds semantic title bars. Terminal.app supports it through documented OSC escape sequences. It's really cool because an icon and a path (interpreted as such, and not just as a generic "title" string) is displayed by the OS, which is right-clickable to pop up the whole path, and clicking on any folder opens it in Finder right away.
As for the generic title string, there's also a distinction between tab title and window title.
In Kitty, implementing support for these escape sequences could enable additional placeholders for
tab_title_template
, such as{wd}
and{document}
in addition to the generic{title}
. This would also make it possibly queryable as a property from kitty remote thus enabling clever scripting, and possibly, who, knows, help in someday implementing restoring windows cd'd into their initial directory.Describe alternatives you've considered
Additional context
The inline doc for the sequences in Apple's Terminal:
The UI leveraging this metadata in action (notice the change in icons):
Shell code that get called on working directory changes to set the "working directory" metadata, as well as the "window title" string (both get displayed independently in my current Terminal configuration, see example above):
Vim code that sets the "document" metadata:
The text was updated successfully, but these errors were encountered: