How does this script for naming iTerm tabs work?

前端 未结 3 1983
难免孤独
难免孤独 2021-02-03 16:41

I\'m trying to name my iTerm tabs and found this link. Here is the pertinent part of the guy\'s post:

I wrote a simple script, which I call “nametab”, whi

3条回答
  •  广开言路
    2021-02-03 16:44

    I was having your same problem - but I saw the tab name briefly flash before going to back to what it was: the shell and the cwd. Turns out I had an environment variable changing the tab name on every shell command, so this fixed it for me:

    export PROMPT_COMMAND=''
    

    Now: echo -e "\033];MY_NEW_TITLE\007"

    ..works just fine and persists.

提交回复
热议问题