{"id":631,"date":"1997-09-09T01:36:29","date_gmt":"1997-09-09T09:36:29","guid":{"rendered":"http:\/\/www.birdhouse.org\/betips\/?p=631"},"modified":"1997-09-09T01:36:29","modified_gmt":"1997-09-09T09:36:29","slug":"current-path-in-terminal-title","status":"publish","type":"post","link":"https:\/\/www.betips.net\/?p=631","title":{"rendered":"Current path in Terminal title"},"content":{"rendered":"<p>You can have the title bar of your Terminal session always report the current working directory. For example, if the current directory is \/boot\/home\/Words, it will say that in the Terminal session&#8217;s title tab. Just add the following function to your <code>\/boot\/home\/.profile<\/code>:<\/p>\n<pre>\nfunction path_title()\n{\necho -en \"33]2;`pwd`07\"\n}\nPROMPT_COMMAND=path_title\n<\/pre>\n<p>Open a new Terminal and try cd&#8217;ing around to see how it works.<\/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>You can have the title bar of your Terminal session always report the current working directory. For example, if the current directory is \/boot\/home\/Words, it will say that in the Terminal session&#8217;s title tab. Just add the following function to your \/boot\/home\/.profile: function path_title() { echo -en &#8222;33]2;`pwd`07&#8220; } PROMPT_COMMAND=path_title Open a new Terminal and [&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-631","post","type-post","status-publish","format-standard","hentry","tag-terminal"],"_links":{"self":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/631","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=631"}],"version-history":[{"count":0,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/631\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}