You are not logged in.
Pages: 1
I would like to set the title in an existing xfce4-terminal instance to the command most recently typed at the command line in that instance. In addition, I would like to be able to specify the font used for this, so that even long command lines will stand a good chance to fit in their entirety within the title region.
In this at all possible? I am running Xfce 4.16 with xfce4-terminal 0.8.10.
Offline
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
I would like to set the title in an existing xfce4-terminal instance to the command most recently typed at the command line in that instance. In addition, I would like to be able to specify the font used for this, so that even long command lines will stand a good chance to fit in their entirety within the title region.
In this at all possible? I am running Xfce 4.16 with xfce4-terminal 0.8.10.
Actually, this is more an issue having to do with the shell in the terminal emulator. In case this can be of help to anybody, when running bash, if one adds the following line to one's .bashrc file:
trap 'echo -ne "\033]2;$(history 1 | sed "s/^[ ]*[0-9]*[ ]*//g")\007"' DEBUG
then every time a new command is typed that command is printed out in the title bar of the xfce4-terminal instance. Still no clue how to change the font size though.
Offline
Depending on your distribution and your shell, you may or may not have it preset in shellrc file. Assuming it's Debian with Bash, first make sure to comment out the following section:
# If this is an xterm set the title to user@host:dir
#case "$TERM" in
#xterm*|rxvt*)
# PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
# ;;
#*)
# ;;
#esac
Somewhere below, assign PROMPT_COMMAND:
PROMPT_COMMAND='echo -ne "\033]0;$(history 1 | cut -d" " -f4-)\007"'
Naturally, to make the changes take effect, sourcing ~/.bashrc is required.
Window title font is set by xfwm4, so you can't really apply only to one app.
Tab title font can be changed via ~/.config/gtk-3.0/gtk.css:
#xfce4-terminal-notebook label {
font-size: 12px;
}
Edit
And I got beaten by ToZ.
Last edited by KBar (2022-07-20 19:44:03)
Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please!
Offline
what if a "solution" used lines typed in even if they are not shell commands, such as a "y/n?" response? would that be OK or do you really need to show commands, only. only the shell would know what is a command as opposed to data (which it would not get). tailing the history file in a script run at every command sounds like the thing.
Offline
Pages: 1
[ Generated in 0.005 seconds, 8 queries executed - Memory usage: 534.66 KiB (Peak: 535.51 KiB) ]