Ashley Coolman
Ashley Coolman

Reputation: 11585

Set tmux pane title to command used with split-window

Question

is it possible to send the <command> given with new-session and split-window, to the pane title?

Background

tmux command

tmux \
  new-session -s start  \
    "lerna bootstrap; read" \; \
  split-window -c "#{pane_current_path}" \
    "yarn api:setup; read" \; \
  split-window -c "#{pane_current_path}" \
    "yarn api:start; read" \; \
  split-window -c "#{pane_current_path}" \
    "yarn spa:start; read" \; \
  split-window -c "#{pane_current_path}" \
    "yarn spa:deps:build; read" \; \
  select-layout even-vertical

~/.tmux.conf

set -g pane-border-format "#P: #{pane_current_command}"

Pane titles

Current

──0: bash─────────────────────

──1: bash─────────────────────

──2: bash─────────────────────

Desired

──0: lerna bootstrap; read─────────────────────

──1: yarn api:setup; read─────────────────────

──2: yarn api:start; read─────────────────────

etc

Upvotes: 1

Views: 1153

Answers (1)

user11274868
user11274868

Reputation:

You can use #{pane_start_command} but it will obviously not update as the running command changes.

Upvotes: 3

Related Questions