Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I am in edit mode in a tmux pane and I do a search, once it reaches the end, it goes back to the beginning. Is there any setting to prevent this?

share|improve this question
do you use / or n to search next result ? – Coren Feb 17 '12 at 11:24
After the first search with /, I use n to get the next results. I tried repeating the search with a combination of / and Enter, but the behaviour doesn't change, once it gets to the end, it comes back to the beginning. – Jacobo de Vera Feb 17 '12 at 12:03
up vote 6 down vote accepted

tmux doesn't have appropriate setting for that, but it's easy to fix it in the source code. I've prepared such patch for you (based on tmux 1.6):


share|improve this answer
Brilliant! It worked perfectly, I appreciate the extra effort in making a patch! Although I suspected the answer would "it can't be done", this is probably the best way to say it :). – Jacobo de Vera Feb 20 '12 at 11:25
Also, you should consider making this depend on a configuration parameter and send it upstream. – Jacobo de Vera Feb 20 '12 at 11:26
In the end I ended up adding the option myself, it will be in 1.7 – Jacobo de Vera Mar 21 '12 at 1:31
@JacobodeVera: Good for you. – przemoc Mar 21 '12 at 6:07

Maybe worth pointing out that this is now (definitely as of tmux 1.9a since that's what I'm on) available via the wrap-search setting:

$ man tmux | grep -B1 -A1 'will wrap'
         wrap-search [on | off]
                 If this option is set, searches will wrap around the end
                 of the pane contents.  The default is on.
share|improve this answer
haha, yeah, I ended up adding that feature and got the patch accepted :) – Jacobo de Vera Nov 26 '14 at 17:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.