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

Command prompt position -- don't hide status line #741

Closed
Nicholas-Autio-Mitchell opened this issue May 13, 2024 · 4 comments
Closed

Command prompt position -- don't hide status line #741

Nicholas-Autio-Mitchell opened this issue May 13, 2024 · 4 comments

Comments

@Nicholas-Autio-Mitchell

I would like to enter tmux commands (using prefix-: and the for the command prompt line itself to appear on a new line just above/below the status line. I don't want to hide the status line underneath.

This is useful because sometimes I want to include arguments in the prompt that I read from the status line e.g. the name of a tab.

I have tried adding the following to my user config, but it had no effect:

# Set the command prompt position
set -g command-prompt-position top

# Add a blank line above the command prompt
set -ag command-prompt-format "%%"

I can't find related issues/docs on this -- is it possible as a config change?

@gpakosz
Copy link
Owner

gpakosz commented May 13, 2024

Hello @Nicholas-Autio-Mitchell 👋,

You can try the following, ⚠️ pretty much untested and very specific to you needs...

Edit your .local customization file and so that it contains the following:

...

bind : run-shell "cut -c3- $TMUX_CONF_LOCAL | sh -s command_prompt"

# -- tpm -----------------------------------------------------------------------

...

# # /!\ do not remove the following line
# EOF
#
# # /!\ do not "uncomment" the functions: the leading "# " characters are needed
#
# command_prompt() {
#   _status=$(tmux show -v 'status')
#   _status_format_0=$(tmux show -v 'status-format[0]')
#   _status_format_1=$(tmux show -v 'status-format[1]')
#   tmux set 'status-format[1]' "$_status_format_0"
#   tmux set status 2
#   tmux command-prompt
#   tmux set status "$_status"
#   tmux set 'status-format[1]' "$_status_format_1"
# }

...

@Nicholas-Autio-Mitchell
Copy link
Author

Thanks for the quick reply!

That did open a new line for the command prompt, but at the same time made the status line disappear (and it never comes back).

@gpakosz
Copy link
Owner

gpakosz commented May 13, 2024

Hmm,

# command_prompt() {
#   _status_format_0=$(tmux show -gv 'status-format[0]')
#   tmux set 'status-format[0]' "$_status_format_0"
#   tmux set 'status-format[1]' "$_status_format_0"
#   tmux set status 2
#   tmux command-prompt
#   tmux set -u 'status-format'
#   tmux set -u status
# }

Is it better?

@Nicholas-Autio-Mitchell
Copy link
Author

That works - thanks a bunch!

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

No branches or pull requests

2 participants