{"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\u2019ve 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\u2019t 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\u2019s a simple way.<\/p>\n<p>There\u2019s a nice option for gnome-terminal <i>-t \u201cTab title\u201d<\/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\u2019s title. So actually setting tab title doesn\u2019t work permanently.<\/p>\n<p>A good solution is to create a new profile (let\u2019s call it \u201cNoTitleChange\u201d) with options set to not to allow tab change. To do this, in gnome-terminal go to <i>Edit->profiles\u2026<\/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\u2026) <\/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\">\u2013tab-with-profile=NoTitileChange -t \u201cMy Permanent title\u201d<\/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\u2019s 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 \u2013tab-with-profile=NoTitleChange -t \u201cPERMANENT\u201d \u2013tab-with-profile=NoTitleChange -t \u201cTABS ARE\u201d \u00a0\u2013tab-with-profile=NoTitleChange -t \u201cAWESOME\u201d<\/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\u2019m using these other options<\/div>\n<div style=\"text-align: left\"><\/div>\n<p><span style=\"font-size: x-small\">-e, \u2013command=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\">\u2013working-directory=DIRNAME<\/span><br \/>\n<span style=\"font-size: x-small\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Set the terminal\u2019s working directory to DIRNAME.<\/span><\/p>\n<p><span style=\"font-size: x-small\">\u2013geometry=GEOMETRY<\/span><br \/>\n<span style=\"font-size: x-small\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0X geometry specification (see \u201cX\u201d man page), can be specified once per window to be opened.<\/span><\/p>\n<p>For example<\/p>\n<p><i>gnome-terminal \u2013tab-with-profile=NoTitleChange -t \u201csrc\u201d \u2013working-directory=\/opt\/workspace\/play\/mnp\/repo\/console_gxt2\/mnpc\u00a0 \u2013tab-with-profile=NoTitleChange -t \u201cDevMode\u201d \u2013working-directory=\/opt\/workspace\/play\/mnp\/repo\/console_gxt2\/mnpc \u2013command=\u201dmvn initialize exec:exec -Pdevel\u201d<\/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\u2019re 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":[],"class_list":{"0":"post-4412","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-development-design"},"_links":{"self":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/4412","targetHints":{"allow":["GET"]}}],"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}]}}