Monday, October 19, 2026

[frgmmhxx] tmux extended regular expression not working

https://github.com/orgs/tmux/discussions/5055 claims tmux supprts Extended Regular Expressions.  "man 7 regex" says "modern" or "extended" has the | operator.

tmux 3.5a-3 amd64 on Debian trixie.

~/.tmux.conf:

set -g status off
set -g mode-keys vi

first, prime the terminal with strings to match:

tmux

echo 'foo|bar'
foo|bar

echo foo
foo

this ought not matter, but including for completeness:

echo $EDITOR
emacs

Ctrl-B [

[0/dddd] appears in top right corner

?

[prompt (search up) appears]

foo|bar
[there is NO incremental highlighting as I type foo|bar]
[hit enter]

literal string "foo|bar" is matched.  repeatedly pressing "n" does not match "foo" by itself.  (2 results) appears in the top right corner.

q

Ctrl-B [

[0/dddd] appears in top right corner

Ctrl-B :

[prompt : appears]

send -X search-backward "foo|bar" [hit enter]

same result as "?"; only literal string "foo|bar" is matched.  repeatedly pressing "n" does not match "foo" by itself.  (2 results) appears in the top right corner.

q

Ctrl-B [

[0/dddd] appears in top right corner

Ctrl-R

[nothing happens, confirming mode-keys has been vi not emacs]

q

Ctrl-B :

[prompt : appears]

set -g mode-keys emacs

Ctrl-B [

?

[nothing happens, as expected in emacs mode]

Ctrl-R

[prompt (search up) appears]

foo
[there IS incremental highlighting as I type "foo"]

No comments :