Segment to display current ssh host name #448
Answered
by
xx4h
davidshen84
asked this question in
Q&A
|
The Do we have a segment to display the ssh host's name? |
Answered by
xx4h
Oct 14, 2024
Replies: 1 comment 1 reply
|
Hi @davidshen84, you're right, We don't have a segment right now for what you want to achieve, but i guess we could try create one. As a first collection of ideas:
To get the |
1 reply
Answer selected by
erikw
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @davidshen84,
you're right,
hostnamesegment is just for displaying the hostname of the system the tmux session is running on.E.g. if you have multiple tmux sessions, running on different systems, you can quickly differentiate between them by the hostname.
We don't have a segment right now for what you want to achieve, but i guess we could try create one. As a first collection of ideas:
tmux display -p -F "#{pane_current_command}"and check forsshsshcommand, we get thepidof the pane withtmux display -p -F "#{pane_pid}"pidwe get all the child PIDs likeps --no-headers --ppid=PANE_PID -o pid,command parse out the ssh PID