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
VTE (which is the base of many Linux terminal emulators like GNOME Terminal, Terminator, Xfce Terminal, etc.) now supports identifying prompts using OSC codes, and therefore jumping between prompts in the terminal output. This is quite useful when lookup back through commands with voluminous output, as you can just press CtrlShift← to jump directly to the previous prompt (and so the start of the output). For this, the /etc/profile.d/vte.sh file adds some customization to PS1, which is naturally lost when using the grml themes:
# Enclose the primary prompt between# ← OSC 133;D;retval ST (report exit status of previous command)# ← OSC 133;A ST (mark beginning of prompt)# → OSC 133;B ST (mark end of prompt, beginning of command line)# [snip]
PS1=$'%{\e]133;D;%?\e\\\e]133;A\e\\%}'"$PS1"$'%{\e]133;B\e\\%}'
I can work around this by doing something like:
zstyle ':prompt:grml:*:items:user' pre $'%{\e]133;D;%?\e\\\e]133;A\e\\%}'
zstyle ':prompt:grml:*:items:sad-smiley' post $'%{\e]133;B\e\\%}%f'
But it would be nice if these could be added by GRML itself, maybe as a configurable theme item.
Looking at it a bit more, something like this seems to be more in the spirit of things:
__vte_prompt_start () {
if [[ ${VTE_VERSION:-0}-ge 7600 ]]
then
REPLY=$'%{\e]133;D;%?\e\\\e]133;A\e\\%}'fi
}
__vte_prompt_end () {
if [[ ${VTE_VERSION:-0}-ge 7600 ]]
then
REPLY=$'%{\e]133;B\e\\%}'fi
}
grml_theme_add_token prompt_start -i __vte_prompt_start ''''
grml_theme_add_token prompt_end -i __vte_prompt_end ''''
zstyle ':prompt:grml:left:setup' items prompt_start rc user at host path vcs percent
zstyle ':prompt:grml:right:setup' items sad-smiley prompt_end
Would it be fine to make a PR adding tokens like these?
The text was updated successfully, but these errors were encountered:
VTE (which is the base of many Linux terminal emulators like GNOME Terminal, Terminator, Xfce Terminal, etc.) now supports identifying prompts using OSC codes, and therefore jumping between prompts in the terminal output. This is quite useful when lookup back through commands with voluminous output, as you can just press CtrlShift← to jump directly to the previous prompt (and so the start of the output). For this, the
/etc/profile.d/vte.sh
file adds some customization toPS1
, which is naturally lost when using the grml themes:I can work around this by doing something like:
But it would be nice if these could be added by GRML itself, maybe as a configurable theme item.
Looking at it a bit more, something like this seems to be more in the spirit of things:
Would it be fine to make a PR adding tokens like these?
The text was updated successfully, but these errors were encountered: