Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved title setting procedure on bash/Ubuntu so that it doesn't destroy PS1 #123

Merged
merged 1 commit into from
Feb 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions TerminalDocs/tutorials/tab-title.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,26 @@ A shell has full control over its own title. However, each shell sets its title
Note that some Linux distributions (i.e. Ubuntu) set their title automatically as you interact with the shell. If the above command doesn't work, run the following command:

```bash
PS1=$
PROMPT_COMMAND=
echo -ne "\033]0;New Title\a"
export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
echo -ne '\033]0;New Title\a'
```

This will change the title to 'New Title', and also set the prompt to '$'.
This will change the title to 'New Title'.

For easier access add this to the end of your `~/.bashrc`:

```bash
settitle () {
export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
echo -ne '\033]0;'"$1"'\a'
}
```

After you reopen your shell, you now can change the shell's title at any time using the following command:

```bash
settitle 'New Title'
```

## Use the `suppressApplicationTitle` setting

Expand Down