Skip to content

tmux.conf: use brackets for if-shell commands #196

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

crpb
Copy link
Contributor

@crpb crpb commented Mar 28, 2025

  • it's easier to read \ó/

Copy link
Member

@mika mika left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea, thanks! Not sure how backwards compatible this is (you've confirmed with bullseye according to IRC), basically LGTM, leaving the +2 to @jkirk :)

@mika mika requested review from zeha, evgeni, ft, jkirk and btittelbach March 28, 2025 12:40
@mika
Copy link
Member

mika commented Mar 28, 2025

From IRC: we seem to have issues with tmate, to be clarified :-/

@crpb
Copy link
Contributor Author

crpb commented Mar 28, 2025

Sadly it seems (fooding old) tmate isn't liking any of those {}

test@obelix:~$ grep '[{}]' /etc/tmux.conf
bind-key B if-shell '! tmux has-session -t bg' {
...
}
test@obelix:~$ tmate
lost server

ant it already complains about this new thing

if-shell "command -v hostname && hostname --help | grep -q -- -I" { set -g status-right "#[fg=green](net: #(hostname -I | sed -e 's/ [^ ]*:.*$//;s/ / | /g;s/ | $//')) #[fg=yellow]%Y-%m-%d %H:%M" } { set -g status-right '#[fg=yellow]%Y-%m-%d %H:%M' }

cb@obelix ~dls % schroot --directory=/ --user root --chroot=source:app_bookworm
obelix# wget -O /etc/tmux.conf https://raw.githubusercontent.com/grml/grml-etc-core/refs/heads/master/etc/tmux.conf
--2025-03-28 15:46:34--  https://raw.githubusercontent.com/grml/grml-etc-core/refs/heads/master/etc/tmux.conf
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8003::154, 2606:50c0:8000::154, 2606:50c0:8001::154, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8003::154|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2844 (2.8K) [text/plain]
Saving to: '/etc/tmux.conf'

/etc/tmux.conf                              100%[========================================================================================>]   2.78K  --.-KB/s    in 0.003s

2025-03-28 15:46:34 (825 KB/s) - '/etc/tmux.conf' saved [2844/2844]

obelix# apt update; apt install -y tmate
....
obelix# tmate
/etc/tmux.conf:65: usage: if-shell [-bF] [-t target-pane] shell-command command [command]                                                                               [0/0]
Tip: if you wish to use tmate only for remote access, run: tmate -F
....

Maybe tmate needs to unlearn about /etc/tmux.conf 🙈

https://salsa.debian.org/debian/tmate/-/blob/upstream/tmux.h?ref_type=heads#L56

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

Successfully merging this pull request may close these issues.

2 participants