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

Set pane ssh title #81

Closed
linuxmail opened this issue Mar 16, 2018 · 7 comments
Closed

Set pane ssh title #81

linuxmail opened this issue Mar 16, 2018 · 7 comments

Comments

@linuxmail
Copy link

Hi,

since I can't use mssh anymore, I learned to love tmux, because of xpanes :-) The only thing I miss under my Linux (bash), is to know, which pane is which (ssh) host. If I connect to 20 hosts or more, I have only the hostname, which you don't see always.
Is there a way to put a small bar under every pane which shows the hostname ?

cu denny

@greymd
Copy link
Owner

greymd commented Mar 20, 2018

Hi @linuxmail ,
Thank you for using tmux-xpanes 😸 !

put a small bar under every pane

As far as I know, both tmux and tmux-xpanes do not have such the feature for now.
But I can understand the matter, and I think it would be really helpful if such the feature existed.

FYI, usually, I update PS1 environment variable when I face same issue.
If you use bash, it may be helpful.

$ ssh -t host01 'export PS1="[host01] \W $ "; bash --norc -i'

It puts the "host01" at the beginning of the interactive screen like this.

[host01] ~ $ 

Therefore, this command line would put the target hostname at the beginning of each pane.
It may help you identify the pane and its target host.

$ xpanes -c 'ssh -t {} "export PS1=\"{} \W $ \";bash --norc -i"' {host01..host20}

@greymd
Copy link
Owner

greymd commented Mar 20, 2018

I came up with a terrible idea 👼
Open new tmux sessions and set the session name on the destination server.
A small bar that has its host name can be placed on each pane !

xpanes -c 'ssh -t {} "tmux new -s {}"' cac0{1..6}

screen shot 2018-03-20 at 18 53 09

Just a kidding, hahaha.

@greymd
Copy link
Owner

greymd commented Mar 22, 2018

It seems that tmux 2.3 and upper version got the feature to customize each pane's border design with pane-border-format property. It might be possible to display the hostname.
Stay tuned.

@linuxmail
Copy link
Author

hi,

whoooo, its incredible 🥇

@greymd
Copy link
Owner

greymd commented Jun 20, 2018

@linuxmail
New option -t was released 👍

v3new

https://github.com/greymd/tmux-xpanes/releases

@greymd greymd closed this as completed Jun 20, 2018
@linuxmail
Copy link
Author

WHOOOOO that is sooo whooo AWESOME. Thank you so much !!

@paxperscientiam
Copy link

paxperscientiam commented Aug 1, 2018

To customize this title, I've found that this function works for setting a custom xpane title:

function title {
    echo -ne "\033]0;"$*"\007"
}

Example I use with an iTerm profile:

command xpanes -t -d -l eh -c "{}" "title money && emacs -s money -- $LEDGER_FILE_PERSONAL" "title accounting && clear"

source: https://superuser.com/a/599156

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

No branches or pull requests

3 participants