Shuzheng
Shuzheng

Reputation: 14018

Does Tmux support any form of command substitution for setting the value of options?

Consider the following hardcoded value of default-shell:

set -g default-shell /usr/local/bin/bash

Does Tmux support any form of command substitution for settings options, e.g.:

set -g default-shell "$(which bash)"

?

I've considered both if-shelland run-shell, but neither suit the purpose of something like command substituion.

Upvotes: 2

Views: 527

Answers (1)

user11274868
user11274868

Reputation:

You can use run-shell, for example:

run 'tmux set -g default-shell "$(which bash)"'

Or for default-shell you could possibly use SHELL. In .tmux.conf you can use $SHELL, or use a format like set -gF default-shell "#{SHELL}".

Upvotes: 1

Related Questions