ohmybash / oh-my-bash

A delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
https://ohmybash.github.io
MIT License
5.73k stars 641 forks source link

How to set xterm title #235

Open viceice opened 3 years ago

viceice commented 3 years ago

I'm using powerline theme and like to update my terminal title.

The default ubuntu promt sets it, but oh-my-posh / powerline them not. So what do i need to add to get a simple title?

Looks like i need to get something like \[\e]0;\u@\h: \w\a\] before the normal $PS1.

viceice commented 3 years ago

Looks like #161 will fix this?

viceice commented 3 years ago

Workaround: add to end of .bashrc

function __term_title {
  PS1="\[\e]0;\u@\h: \w\a\]${PS1}"
}

PROMPT_COMMAND="${PROMPT_COMMAND};__term_title"