Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

2 Answers 2

up vote 6 down vote accepted
+50

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):

https://gist.github.com/1861273

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 at 17:38

Your Answer

 
discard

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.