{"id":278,"date":"1997-09-09T01:36:29","date_gmt":"1997-09-09T09:36:29","guid":{"rendered":"http:\/\/www.birdhouse.org\/betips\/?p=278"},"modified":"1997-09-09T01:36:29","modified_gmt":"1997-09-09T09:36:29","slug":"title-your-terminal-pt-ii","status":"publish","type":"post","link":"https:\/\/www.betips.net\/?p=278","title":{"rendered":"Title your Terminal pt. II"},"content":{"rendered":"<p>This tip builds on the information in the tip <a href=\"\/chunga.php?ID=076\"> Title your Terminal<\/a>.<br \/>\nIf you&#8217;d like the title of your Terminal windows to reflect the current working directory, you need to do two things:<br \/>\n1) Edit your <code>.profile<\/code> file (in your home directory) and add the line<\/p>\n<pre>PROMPT_COMMAND=~\/config\/bin\/term<\/pre>\n<p>2) Create a file called <code>term<\/code> (or use any name, just make sure that the <code>PROMPT_COMMAND<\/code> from step 1 matches this name) in <code>\/boot\/home\/config\/bin<\/code>. This file should contain the following code:<\/p>\n<pre>\necho -e \"33]2;`pwd`07\" <\/pre>\n<p>Restart Terminal, and your title string should be <code>\/boot\/home<\/code>. It will change as you change directories, because <code>PROMPT_COMMAND<\/code> will be executed every time you issue a command at the Terminal prompt.<\/p>\n<hr \/>\n<p>Cash Erler (erlercw@yahoo.com) adds:<br \/>\nChange the echo -e in the script to <code>echo -en<\/code>.<br \/>\nThis will show the working directory in the titlebar and will not print the extra newline each time (which Terminal doesn&#8217;t do normally, and can be annoying)<\/p>\n<hr \/>\n<p>Peter Folk (pfolk@gargtech.com) adds: The command from this tip wasn&#8217;t correctly quoted, so it didn&#8217;t make it through the HTML system. The correct command is below:<br \/>\n <code>echo -en '\\\\033]2;TextInTitle\\\\007'<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tip builds on the information in the tip Title your Terminal. If you&#8217;d like the title of your Terminal windows to reflect the current working directory, you need to do two things: 1) Edit your .profile file (in your home directory) and add the line PROMPT_COMMAND=~\/config\/bin\/term 2) Create a file called term (or use [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[11],"class_list":["post-278","post","type-post","status-publish","format-standard","hentry","tag-terminal"],"_links":{"self":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/278","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=278"}],"version-history":[{"count":0,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/278\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}