Skip to content
Discussion options

You must be logged in to vote

Hi @davidshen84,

you're right, hostname segment 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:

  1. Get tmux display -p -F "#{pane_current_command}" and check for ssh
  2. If we've a ssh command, we get the pid of the pane with tmux display -p -F "#{pane_pid}"
  3. Based on that pid we get all the child PIDs like ps --no-headers --ppid=PANE_PID -o pid,comm and parse out the ssh PID
  4. We retrieve information abo…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@erikw
Comment options

Answer selected by erikw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants