Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

9
  • Well, it is rather complicated, but I have pasted it to a .sh script, executed, and nothing seems to have changed. At least my prompt keeps the same. Commented Nov 9, 2014 at 4:26
  • @SopalajodeArrierez Did you run this in a separate script? That won't work: the script doesn't influence its parent shell. You need to run this inside bash. This code is meant to go into your .bashrc. Since I add the title-setting code to what's already there, this should replace the existing part that adds the title-setting code. Commented Nov 9, 2014 at 4:37
  • Tested in both ways. Even on ~/.bashrc nothing seems to have changed. I put your script right after my export PS1= line. Commented Nov 9, 2014 at 5:21
  • @SopalajodeArrierez Put set -x before the snippet and set +x after, and tell me what is printed when you run bash (it'll start with + title_text='\u@\h: \w') as well as the resulting value of PS1 (edit your question or use pastebin.com or whatever you prefer). Commented Nov 9, 2014 at 6:45
  • Here you have, thanks you: pastebin.com/ish0Epnu Commented Nov 9, 2014 at 15:30