Set the terminal tab title as prompt name in unix

后端 未结 2 785
一整个雨季
一整个雨季 2021-01-23 03:52

Lets say, the prompt is as below

run_scripts >

How to set that terminal tab title same as prompt i.e Terminal tab tile also should be

相关标签:
2条回答
  • 2021-01-23 04:10

    Many terminals emulators are able to understand the special escaping : "\033]0;foo\007".

    0 讨论(0)
  • 2021-01-23 04:14

    I know its a old post but i saw it today : Here is the answer:

    title `pwd`
    

    if title command does not works in your shell then:

    1. write a shell script with follwing contents (filename = title)
    #!/usr/bin/tcsh -f
    echo "^[]2;$1^G^[]1;$1^G"
    
    1. then:
    chmod +x title (give this script executable permission)
    
    1. type:
    title `pwd` <enter>
    
    0 讨论(0)
提交回复
热议问题