Skip to content

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

Open
crpb wants to merge 1 commit into
grml:masterfrom
crpb:tmuxconf
Open

tmux.conf: use brackets for if-shell commands#196
crpb wants to merge 1 commit into
grml:masterfrom
crpb:tmuxconf

Conversation

@crpb

@crpb crpb commented Mar 28, 2025

Copy link
Copy Markdown
Contributor
  • it's easier to read \ó/

@mika mika left a comment

Copy link
Copy Markdown
Member

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 btittelbach, evgeni, ft, jkirk and zeha March 28, 2025 12:40
@mika

mika commented Mar 28, 2025

Copy link
Copy Markdown
Member

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

@crpb

crpb commented Mar 28, 2025

Copy link
Copy Markdown
Contributor Author

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

@zeha

zeha commented Aug 26, 2025

Copy link
Copy Markdown
Member

This needs at least a rebase, and also the tmate issue needs to be sorted out.

@crpb

crpb commented Oct 4, 2025

Copy link
Copy Markdown
Contributor Author

also the tmate issue needs to be sorted

thougts? https://salsa.debian.org/cb/tmate/-/commit/0dae773b26e929bb448f29a60aeb8fe0b45c42a0

@zeha

zeha commented Oct 4, 2025

Copy link
Copy Markdown
Member

did that land in forky?

i'd be ok with it being broken on trixie (if it works in forky), duno about the others.

@zeha

zeha commented Oct 4, 2025

Copy link
Copy Markdown
Member

i'd be ok with it being broken on trixie (if it works in forky), duno about the others.

on second thought, doing this for grml-etc-core would be bad. users expect better backwards compat.

@crpb

crpb commented Oct 4, 2025

Copy link
Copy Markdown
Contributor Author

did that land in forky?

no, i only created that here for me today to see if it works and it does.
but yeah, it would break even trixie if send in and then even accepted with this /etc/tmux.con

@mika

mika commented Oct 6, 2025

Copy link
Copy Markdown
Member

did that land in forky?

no, i only created that here for me today to see if it works and it does. but yeah, it would break even trixie if send in and then even accepted with this /etc/tmux.con

I'd love to have https://salsa.debian.org/cb/tmate/-/commit/0dae773b26e929bb448f29a60aeb8fe0b45c42a0 available, but I agree, we shouldn't break backwards compatibility. :-/

@zeha

zeha commented Feb 11, 2026

Copy link
Copy Markdown
Member

Dev Meeting Result: Until the referenced commits lands in oldstable, this needs to be put back.

@zeha zeha moved this from Accepted to Backlog in Grml Release Feb 11, 2026

@zeha zeha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Needs to wait for Debian oldstable

@zeha

zeha commented Feb 16, 2026

Copy link
Copy Markdown
Member

@mika wdyt about adding a tmate alias that expands to tmate -f $HOME/.tmate.conf, which could then be a custom tmate.conf?
Don't know if this is feasible, but maybe worth considering?

@mika

mika commented Feb 21, 2026

Copy link
Copy Markdown
Member

@mika wdyt about adding a tmate alias that expands to tmate -f $HOME/.tmate.conf, which could then be a custom tmate.conf? Don't know if this is feasible, but maybe worth considering?

I love this idea and just implemented it.
But tmate is really stupid: it still reads the global /etc/tmux.conf, even when explictly running tmate -f ... :(

So I don't see any way forward to continue usage of tmate with tmux :(
Related: #247

@zeha

zeha commented Feb 21, 2026

Copy link
Copy Markdown
Member

@mika wdyt about adding a tmate alias that expands to tmate -f $HOME/.tmate.conf, which could then be a custom tmate.conf? Don't know if this is feasible, but maybe worth considering?

I love this idea and just implemented it. But tmate is really stupid: it still reads the global /etc/tmux.conf, even when explictly running tmate -f ... :(

Ugh, that seems bad.

So I don't see any way forward to continue usage of tmate with tmux :( Related: #247

So ... out with tmate?

@mika

mika commented Feb 21, 2026

Copy link
Copy Markdown
Member

@mika wdyt about adding a tmate alias that expands to tmate -f $HOME/.tmate.conf, which could then be a custom tmate.conf? Don't know if this is feasible, but maybe worth considering?

I love this idea and just implemented it. But tmate is really stupid: it still reads the global /etc/tmux.conf, even when explictly running tmate -f ... :(

Ugh, that seems bad.

Yes :(

So I don't see any way forward to continue usage of tmate with tmux :( Related: #247

So ... out with tmate?

At least plan its removal and a better replacement, yeah :(

@evgeni

evgeni commented Feb 21, 2026

Copy link
Copy Markdown
Member

I've been using upterm for similar things as tmate recently, but no idea if that's packaged.

@mika

mika commented Feb 21, 2026

Copy link
Copy Markdown
Member

I've been using upterm for similar things as tmate recently, but no idea if that's packaged.

ACK thanks, upterm sadly isn't packaged yet (see #247)

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

5 participants