Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use #{hostname} in session list #455

Open
fgionghi opened this issue Feb 18, 2021 · 4 comments
Open

Use #{hostname} in session list #455

fgionghi opened this issue Feb 18, 2021 · 4 comments
Labels

Comments

@fgionghi
Copy link

Hi,
i'm using oh my tmux on ubuntu 20.04 server.
What I would like to do do is automatically use the hostname either on the status bar (accomplished simply using #{hostname} on tmux_conf_theme_status_left) and also on the session list (C-a s).

What am I missing? Thanks.

@gpakosz
Copy link
Owner

gpakosz commented Feb 18, 2021

Hello @fgionghi 👋

I'm not sure what you're trying to achieve.
Can you please post a screenshot of where you would like hostname to be used?

@fgionghi
Copy link
Author

fgionghi commented Feb 18, 2021

Of course.
Here I have the default config, pressed C-a $, renamed the session test and the result can be seen in the status bar AND in the session list (C-a s):
image

This is ok, but i would like all this process to be automatic as I connect in ssh to a hostname.
To say this in different words: when i connect in ssh to a host i would like to rename automatically my session name with the hostname of the machine EITHER in the status bar AND in the session list.

The solution I have found only partially resolve my issue:
what i did is use #{hostname} on tmux_conf_theme_status_left instead of #S and as I connect to a host in ssh the name of the session in the status bar change accordingly BUT the name in the session list remain a number. This last sentence is my problem.
I'm pretty sure this is something simple and I am missing something.
Hope I have explain my self better! Thank you

@gpakosz
Copy link
Owner

gpakosz commented Feb 18, 2021

The solution I have found only partially resolve my issue

Well yes, deciding to display something different than #{session_name} in the status bar is different from renaming a session upon connecting to a remote host.

Also, what if within the same session you have 2 panes connected to different hosts?

@fgionghi
Copy link
Author

fgionghi commented Feb 18, 2021

Well yes, deciding to display something different than #{session_name} in the status bar is different from renaming a session upon connecting to a remote host.

Yeah you are right.

Also, what if within the same session you have 2 panes connected to different hosts?

In this case it's ok to show the host of the first pane, but anyway I I set tmux_conf_new_pane_reconnect_ssh to true so this shouldn't be a problem. Same thing with windows... I mostly use a session on just one single remote host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants