How can I make the terminal tab display <name of process running (vim, bash, ruby, etc)> - <parent directory/current directory>?
Asked
Active
Viewed 96 times
0
cabe56
- 101
- 2
-
What application is it that you are using to record. The question seems pretty specific to that piece of software since you are asking how it is you can adjust the output from that software... – JNevill Sep 18 '14 at 17:28
-
Removed to avoid confusion – cabe56 Sep 18 '14 at 18:32
1 Answers
0
By outputting an escape sequence you can modify the title of xterm (and many other terminal programs do this as well). E.g.:
PS1='\[\e]0;\u@\h: \w\a\]\u@\h:\w\$ '
shows username@hostname:currentdirectory as the title (and the same as prompt). Specifically the part between \e]0; and \a is used; \e is the escape character and \a is the alarm or bell character (ctrl-G). The \[ \] surrounding that is so that bash knows those bytes aren't displayed on the command line, and editing the line doesn't mess up positions.
To add the command name you could look at this post for ideas.