Renaming Terminal Windows

Courtasy of Ctrl-C's IRC, specifically user XWindows:

"is there a way to have terminal sessions named"

if your terminal is_that_ crippled (not surprising when it was GNOME3+ Terminal)...

1. Confirm if `echo "$TERM"` command shows something that starts with`xterm`

2. If it does, confirm that a command `printf '\e]0;Hello World\a'; read LINE` temporarily changes your tab's title to "Hello World".

3. If it does, press Enter to dismiss, then confirm that you are using POSIX-compatible shell (e.g. FISH doesn't)

4. If you are, run `printf "%s\n" "$PS1"`.

5. You would see a long jumble of escape thingamajig, look for the first occurence of `\[\e]0;` and the first occurence of `\a\]` following that.

6. Run a "command" that comprises of `PS1='`, immediately followed by the whole escape thingamagig line copied over *but* replace anything between the pair of delimiters I've instructed you to look for with your desired window title, and end the entire line with `'` (single quote). Press Enter. If it works, you might want to have a shell function to automate that in the future.


My takeaway from this:



Go Home