{"id":4412,"date":"2012-05-31T08:33:00","date_gmt":"2012-05-31T07:33:00","guid":{"rendered":"http:\/\/touk.pl\/blog\/?guid=0c99b096df405072e4ecf91b2fdef3f3"},"modified":"2022-08-03T12:49:23","modified_gmt":"2022-08-03T10:49:23","slug":"how-to-set-gnome-terminal-tab-title-permanently","status":"publish","type":"post","link":"https:\/\/touk.pl\/blog\/2012\/05\/31\/how-to-set-gnome-terminal-tab-title-permanently\/","title":{"rendered":"How to set gnome-terminal tab title. Permanently&#8230;"},"content":{"rendered":"<p>I&#8217;ve been looking for this a few times without success. There are some nasty proposals with setting PS1 variable or other tricks with <i>.bashrc<\/i> mods. Weak and doesn&#8217;t actually work.<br \/>\nI needed a way to make a bash script that opens several tabs with fixed titles and with fixed start directories and with already started programs (for example <i>tail\/less<\/i> of log files). Or solutions are very complicated.<\/p>\n<p>There&#8217;s a simple way.<\/p>\n<p>There&#8217;s a nice option for gnome-terminal <i>-t &#8220;Tab title&#8221;<\/i> which allows you to set a title for a tab. But in default profile (a switchable terminal behavior configuration) any program or bash prompt can change tab&#8217;s title. So actually setting tab title doesn&#8217;t work permanently.<\/p>\n<p>A good solution is to create a new profile (let&#8217;s call it &#8220;NoTitleChange&#8221;) with options set to not to allow tab change. To do this, in gnome-terminal go to <i>Edit-&gt;profiles&#8230;<\/i>\u00a0click <i>New, <\/i>apply new name. Then in tab <i>Title and Command<\/i>\u00a0from drop box (<i>When commands set own title&#8230;) <\/i>choose <i>Keep initial title.<\/i><br \/>\n<i><br \/>\n<\/i><br \/>\nNow you can invoke<\/p>\n<p><i>gnome-terminal\u00a0<span style=\"text-align: left\">&#8211;tab-with-profile=NoTitileChange -t &#8220;My Permanent title&#8221;<\/span><\/i><br \/>\n<span style=\"text-align: left\"><br \/>\n<\/span><\/p>\n<div style=\"text-align: left\">and nothing will change the tab&#8217;s title.<\/div>\n<div style=\"text-align: left\"><\/div>\n<div style=\"text-align: left\">You can play with these and other options to create many tabs in one window.<\/div>\n<div style=\"text-align: left\"><\/div>\n<div style=\"text-align: left\"><i>gnome-terminal &#8211;tab-with-profile=NoTitleChange -t &#8220;PERMANENT&#8221; &#8211;tab-with-profile=NoTitleChange -t &#8220;TABS ARE&#8221; \u00a0&#8211;tab-with-profile=NoTitleChange -t &#8220;AWESOME&#8221;<\/i><\/div>\n<div style=\"text-align: left\"><\/div>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a style=\"margin-left: 1em;margin-right: 1em\" href=\"http:\/\/2.bp.blogspot.com\/-2Jlha1ZXn4U\/T8cc_-dIgeI\/AAAAAAAABQ4\/r2Te3AksznY\/s1600\/permanent_tabs.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/2.bp.blogspot.com\/-2Jlha1ZXn4U\/T8cc_-dIgeI\/AAAAAAAABQ4\/r2Te3AksznY\/s320\/permanent_tabs.png\" width=\"320\" height=\"220\" border=\"0\" \/><\/a><\/div>\n<div style=\"text-align: left\"><\/div>\n<div style=\"text-align: left\">I&#8217;m using these other options<\/div>\n<div style=\"text-align: left\"><\/div>\n<p><span style=\"font-size: x-small\">-e, &#8211;command=STRING<\/span><br \/>\n<span style=\"font-size: x-small\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Execute the argument to this option inside the terminal.<\/span><\/p>\n<p><span style=\"font-size: x-small\">&#8211;working-directory=DIRNAME<\/span><br \/>\n<span style=\"font-size: x-small\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Set the terminal&#8217;s working directory to DIRNAME.<\/span><\/p>\n<p><span style=\"font-size: x-small\">&#8211;geometry=GEOMETRY<\/span><br \/>\n<span style=\"font-size: x-small\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0X geometry specification (see &#8220;X&#8221; man page), can be specified once per window to be opened.<\/span><\/p>\n<p>For example<\/p>\n<p><i>gnome-terminal &#8211;tab-with-profile=NoTitleChange -t &#8220;src&#8221; &#8211;working-directory=\/opt\/workspace\/play\/mnp\/repo\/console_gxt2\/mnpc\u00a0 &#8211;tab-with-profile=NoTitleChange -t &#8220;DevMode&#8221; &#8211;working-directory=\/opt\/workspace\/play\/mnp\/repo\/console_gxt2\/mnpc &#8211;command=&#8221;mvn initialize exec:exec -Pdevel&#8221;<\/i><\/p>\n<div style=\"text-align: left\"><\/div>\n<div style=\"text-align: left\">Now you can create start script that opens proper working dirs (with source code for example) and with server logs open. And you&#8217;re ready to go!<\/div>\n","protected":false},"excerpt":{"rendered":"I&#8217;ve been looking for this a few times without success. There are some nasty proposals with setting PS1 variable or other tricks with .bashrc mods. Weak and doesn&#8217;t actually work.I needed a way to make a bash script that opens several tabs with fixed t&#8230;\n","protected":false},"author":22,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"_links":{"self":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/4412"}],"collection":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/comments?post=4412"}],"version-history":[{"count":11,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/4412\/revisions"}],"predecessor-version":[{"id":14933,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/4412\/revisions\/14933"}],"wp:attachment":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/media?parent=4412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/categories?post=4412"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/tags?post=4412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}