1

I am using powerline with bash, fish, and tmux. The hostname shows up when logging in to remote systems with SSH. But I want to also enable the hostname segment for local users. Here is how it looks on a remote system.

enter image description here

Here is how it looks on as a local user. Note that I have hostname set on the local machine.

enter image description here

The tmux theme works fine.

enter image description here

I have tried editing the default theme by omitting the priority to always show the hostname segment disregarding the display width, and also edited the "only_if_ssh": false argument. How can I enable showing the hostname in the shell prompt as well?

1 Answer 1

1

I had to change the following config files to show the hostname for a local system.

  • Change powerline/config.json to make the key ext:shell:theme point to my custom theme .json file
  • Customize the theme file to your liking. I have the following in addition to other entries.
{
  "segments": {
     "left": [
     {
        "function": "powerline.segments.common.net.hostname",
        "priority": 10
     }
  }
}
  • Edit __main__.json as follows.
{
   "segment_data": {
     "hostname": {
       "args": {
         "only_if_ssh": false
       }
     }
   }
 }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.