Chém gió

Thứ Năm, 1 tháng 1, 2015

[Ubuntu] Change gnome-terminal title dynamically

For some reasons you might want to change your terminal title 
1. Open terminal
2. Edit file ~/.bashrc add this function at the end of file:

function title {
    echo -en "\033]2;$1\007"
}
Comment PS1: #PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
Save it. 
3. From terminal at home directory type:
> source .bashrc 
For setting take effect on the system.
From current terminal want to change it's title just type:
> title "Your Title Here"
That's it.

Không có nhận xét nào:

Đăng nhận xét