Re: tmux and terminfo's el and ed
(08/12/2011 11:07 AM), Julius Plenz wrote: Hi! I'm not quite sure what to make of this. Both screen and tmux won't handle terminfo's el and ed (clear to end of line/display) the way I think it should work. Consider: echo `tput setab 2`foo`tput el`\r I would expect to find the line cleared (and colored!) until the end. In XTerm and Rxvt this works like expected, in tmux (and screen) it doesn't. Take a look at the screenshot at http://www.plenz.com/imgdump/2011-08-12-194658_585x153_scrot.png - top is a regular terminal, below the same command in tmux. Color-on-erase should only be expected when the terminal advertises support for bce (background color erase), which neither screen nor tmux can guarantee (since the host term must also support it). IIRC, screen _can_ support it, if the host terminal does. You have to explicitly set bce to on in your ~/.screenrc. In which case it is recommended that you set TERM to screen-bce within screen (to advertise that support). -- Micah J. Cowan http://micah.cowan.name/ -- FREE DOWNLOAD - uberSVN with Social Coding for Subversion. Subversion made easy with a complete admin console. Easy to use, easy to manage, easy to install, easy to extend. Get a Free download of the new open ALM Subversion platform now. http://p.sf.net/sfu/wandisco-dev2dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Provide command line arguments with arguments
On 05/28/2011 03:28 PM, Helmut Schneider wrote: While from a shell you can put single quotation marks around the comman when you e.g. put your script into an alias or call it from another script there is/seems no way to do that successfully. Your sentence here doesn't make much sense to me, but I'm going to guess that you mean to say that while you can put single quotes around the arguments in an interactive shell, you can't do that from an alias or another script. Which is obviously untrue. It sounds to me like you need to learn to use quotes in your shell a bit better. Here are some examples that should demonstrate how you might accomplish what you're after. tmux new '/usr/local/bin/patch_all.sh -H host1 host2 host3' alias foo=tmux new '/usr/local/bin/patch_all.sh -H \host1 host2 host3\' or alias foo='tmux new '\''/usr/local/bin/patch_all.sh -H host1 host2 host3'\' (Please excuse the line-wrapping.) -- Micah J. Cowan http://micah.cowan.name/ -- vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Display behaviour, clearing, etc.
(05/18/2011 08:01 AM), Randy Stauner wrote: I have tried to recreate this according to your steps and it does not happen to me, things look as you would expect them. I tried zsh as well--no change. It does seem odd that even the prompt disappears in your example. This probably won't help, but might be worth a try: Try putting this line in your ~/.vimrc: set t_ti= t_te= That tells vim, also, not to clear the screen (like alternate-screen off). Does that change anything? If it doesn't, then Randy perhaps you could run your entire session under the script command? Fire off the tmux command neww script and then attach (not copy/paste) the transcript to a response? If you don't have script, then use pipe-pane to cat ~/typescript or something. -- Micah J. Cowan http://micah.cowan.name/ -- What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Display behaviour, clearing, etc.
(05/18/2011 11:18 AM), Robin Lee Powell wrote: Huh. My tmux.conf doesn't seem to actually *work*; I have to manually do a :set-window-option alternate-screen when I launch tmux for it to actually be set correctly. That's a bit odd, isn't it? So in the tmux case there's a step for that, before running script. Make sure to add the explicit off at the end, if you didn't. If your .tmux.conf is not even being read, then that's usually a sign that your tmux server was already running (.tmux.conf is only read at server startup, not at the start of every new session) - so if there's still a (detached?) session running, you need to make sure tmux is dead. killall tmux is one way to ensure that. -- Micah J. Cowan http://micah.cowan.name/ -- What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Display behaviour, clearing, etc.
(05/18/2011 11:18 AM), Robin Lee Powell wrote: http://teddyb.org/~rlpowell/media/public/tmp/screen.txt http://teddyb.org/~rlpowell/media/public/tmp/tmux.txt Do you still get the same effect if you set your prompt to something that doesn't contain any special character sequences? I don't see anything odd about what vim does, but your prompt string seems to do several fairly funky things, including printing several lines worth of spaces, then backing over them, and clearing the remainder of the screen and line. I'd be willing to bet that it's related to the behavior you're seeing. If that does turn out to be the case, perhaps you could enlighten us about how your prompt is set up, so we can figure out why you're seeing this behavior in tmux and not screen. (FYI, I used my program GNU Teseq to analyze your typescript files; via teseq -x tmux.txt. I diffed the results for both tmux and screen, but didn't see anything worth bothering with; the differences seemed mainly to do with there being a one-line difference between the display area within screen and tmux.) -- Micah J. Cowan http://micah.cowan.name/ -- What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Display behaviour, clearing, etc.
(05/18/2011 01:19 AM), Robin Lee Powell wrote: It's vim, not less, and yes, it appears to be overwriting. The issue is that I don't have this problem in screen. OK, screenshots of screen and tmux (in alternate-screen off mode). Process is: [new window] # seq 1 100 # vim [type some crap] :q! [backscroll mode, up 10 lines, screenshot] To be absolutely clear, by backscroll mode, you mean tmux's copy-mode, right? It's not some scrollback that's built into the terminal, is it? -- Micah J. Cowan http://micah.cowan.name/ -- What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Display behaviour, clearing, etc.
(05/18/2011 01:28 PM), Micah Cowan wrote: (05/18/2011 01:19 AM), Robin Lee Powell wrote: It's vim, not less, and yes, it appears to be overwriting. The issue is that I don't have this problem in screen. OK, screenshots of screen and tmux (in alternate-screen off mode). Process is: [new window] # seq 1 100 # vim [type some crap] :q! [backscroll mode, up 10 lines, screenshot] To be absolutely clear, by backscroll mode, you mean tmux's copy-mode, right? It's not some scrollback that's built into the terminal, is it? See, here's the thing: I can't reproduce your symptoms, even by catting your tmux.txt and tmux2.txt directly into my tmux session (with hopefully approximately the same dimensions - I'm using 195x73 (72 within tmux - not that it should really matter)). Every time, when I enter copy-mode, I can see the 150 from seq after exiting tmux. I'm using the tmux from CVS HEAD. Perhaps you can try that out? -- Micah J. Cowan http://micah.cowan.name/ -- What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Display behaviour, clearing, etc.
(05/18/2011 01:47 PM), Robin Lee Powell wrote: On Wed, May 18, 2011 at 01:43:38PM -0700, Micah Cowan wrote: (05/18/2011 01:28 PM), Micah Cowan wrote: (05/18/2011 01:19 AM), Robin Lee Powell wrote: It's vim, not less, and yes, it appears to be overwriting. The issue is that I don't have this problem in screen. OK, screenshots of screen and tmux (in alternate-screen off mode). Process is: [new window] # seq 1 100 # vim [type some crap] :q! [backscroll mode, up 10 lines, screenshot] To be absolutely clear, by backscroll mode, you mean tmux's copy-mode, right? It's not some scrollback that's built into the terminal, is it? See, here's the thing: I can't reproduce your symptoms, even by catting your tmux.txt and tmux2.txt directly into my tmux session (with hopefully approximately the same dimensions - I'm using 195x73 (72 within tmux - not that it should really matter)). Every time, when I enter copy-mode, I can see the 150 from seq after exiting tmux. Yeah, I thought we had already established that you couldn't repro. Catting it out has the same problems for me. Well, we had already established that I couldn't repro via the same _steps_ as you. But now we've established that I couldn't even repro with the same exact terminal codes that were sent to tmux, which is rather different. There's plenty of ways that we could get different results from the same steps, but there aren't many ways we could get different results from the same escape sequences. Assuming that the problem is that the scrollback is being overwritten (the other possibility would be that it's not being drawn properly when you go to copy-mode, but this seems less likely), the only real explanation I can think of is that there's a crucial difference between the way our tmuxen behave, yours and mine. You mentioned not changing Putty, but I can't think of a good reason that Putty would be directly involved. Particularly since your latest script demonstrates that tmux is definitely even sending the codes to draw the appropriate bit of the scrollback. It's possible that the setting of TERM (set by Putty) could effect that in some way (what's it set to, xterm?), but beyond that... -- Micah J. Cowan http://micah.cowan.name/ -- What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Display behaviour, clearing, etc.
(05/18/2011 01:47 PM), Robin Lee Powell wrote: I'm using the tmux from CVS HEAD. Perhaps you can try that out? Certainly. Okay, good news: I grabbed a copy of tmux 1.4 from sourceforge, built and tested with it. I can reproduce. So it sounds like it's a problem that has since been fixed, since I'm not reproducing it from HEAD. Hopefully it won't be a problem to get that version onto your affected machines? -- Micah J. Cowan http://micah.cowan.name/ -- What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Display behaviour, clearing, etc.
(05/18/2011 02:56 PM), Robin Lee Powell wrote: Terminal size is 80x25, because I believe that to actually be relevant to the behaviour one gets on catting them back out. Well, what I meant (and should have said) was, provided that the lines all start where they're meant to. http://teddyb.org/~rlpowell/media/public/tmp/tmux_new_1.txt There is definitely some different behavior of vim under tmux here. And the reason it's still happening is that, before, vim was issuing clear screen, which in many terminals actually just scrolls a full page rather than truly erasing. It looks like previous versions of tmux would actually erase the screen, rather than scroll a page-size, which was the source of your trouble there (Note that was still completely legitimate behavior, but I'm definitely happier with the current behavior). However, according to tmux_new_1.txt, vim is no longer issuing the clear screen code; it just jumps to column 1 and starts drawing. That's guaranteed to overwrite history (except when alternate-screen is _on_, in which case it'd get restored back on exit - but then it would overwrite the remains that you like to have). A workaround should be to alias vim to 'clear; vim' or something. What I don't understand is: what made vim change what it's sending in terminal codes? TERM was set to screen in both cases, right? ...or do you have TERM set inappropriately within tmux? And why isn't it doing the exact same thing when you're running it under screen? It looks like vim _is_ still sending the clear-screen codes in screen_new_1.txt (which is why it's still working)... what's different? I suspect you changed something relative to how you were running it in tmux2.txt; something made it stop clearing the screen. Fascinatingly, I just discovered by accident that if I run screen with tmux underneath it, and use screen's backscroll, I still can't see the lines that vim overwrites. No surprise there. Tmux doesn't try to preserve the host terminal's scrollback as far as I know. Under tmux (with zsh), *this is also true*: catting screen_new_1.txt gives me 150 inbackscroll; catting tmux_new_1.txt gives me only 128 in backscroll. Yeah, this makes sense given my explanation above. The key question is, what's different inside the screen/tmux terminal that is causing clear not to be sent. You mentioned not changing Putty, but I can't think of a good reason that Putty would be directly involved. Particularly since your latest script demonstrates that tmux is definitely even sending the codes to draw the appropriate bit of the scrollback. Wait, what? tmux_script.txt shows that tmux is *not* showing all the way down to 150? Um, right. Just like you said it wasn't? It shows all the way down to 150, and does some vimmy stuff, and then when you do a scrollback, it only draws it down to like 129. But this is all done at once of course, since you don't have timing info. -- Micah J. Cowan http://micah.cowan.name/ -- What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Solved? (was Re: Display behaviour, clearing, etc.)
(05/18/2011 03:55 PM), Robin Lee Powell wrote: On Wed, May 18, 2011 at 03:27:20PM -0700, Micah Cowan wrote: A workaround should be to alias vim to 'clear; vim' or something. Ah. Yes, that works; with older tmux I had tested clear and it broke in the same way vim does, but with HEAD this works fine. What I don't understand is: what made vim change what it's sending in terminal codes? TERM was set to screen in both cases, right? ...or do you have TERM set inappropriately within tmux? And why isn't it doing the exact same thing when you're running it under screen? It looks like vim _is_ still sending the clear-screen codes in screen_new_1.txt (which is why it's still working)... what's different? *Interesting*. Under screen, the terminal is screen-bce. Under tmux, it's screen. If I set the terminal to screen-bce under tmux HEAD, the problem goes away. It doesn't appear help on 1.3 on the same machine, or 1.4 on the other machine, only HEAD. Not a great idea to leave it that way as a solution, though; tmux doesn't do bce, I believe. This makes a difference to some apps, like (probably?) dialog or maybe mc, or even vim probably if you use background colors. But it definitely helps explain why you found it necessary to turn bce on in your screen config. :) My suspicion, therefore, is that the screen terminal on your machine is like the screen-bce terminal on mine, somehow. I don't really know much about terminal definitions; if you tell me how to dump it, I will. Assuming you have the appropriate tools installed (usual case), you can do infocmp screen and infocmp screen-bce to compare them. If you direct those to files, you can compare with wdiff (best) or diff (fallback). Literally the only change, aside from names and comments, should be that screen-bce advertises a bte capability that screen doesn't. Most likely, the broken capability is named clear. My screen has: ... clear=\E[H\E[J, cnorm=\E[34h\E[?25h, cr=^M, ... which is correct. If your screen has something else, or lacks a clear altogether, that'd be your problem. You can edit the files you created by directing infocmp, and then feed them back into terminfo's system by specifying them as the argument of the tic command, if you have that installed. If you run it as root, it installs it system-wide, otherwise it installs it at a special place under your home directory, and it will of course only impact that specific user. I believe the GNU screen sources include appropriate terminfo definitions, so if you download that you can feed them to tic to be sure you're using the latest officially recommended ones. I really *really* appreciate all your help. You're welcome. :) -- Micah J. Cowan http://micah.cowan.name/ -- What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Solved? (was Re: Display behaviour, clearing, etc.)
(05/18/2011 04:07 PM), Micah Cowan wrote: (05/18/2011 03:55 PM), Robin Lee Powell wrote: On Wed, May 18, 2011 at 03:27:20PM -0700, Micah Cowan wrote: A workaround should be to alias vim to 'clear; vim' or something. Ah. Yes, that works; with older tmux I had tested clear and it broke in the same way vim does, but with HEAD this works fine. What I don't understand is: what made vim change what it's sending in terminal codes? TERM was set to screen in both cases, right? ...or do you have TERM set inappropriately within tmux? And why isn't it doing the exact same thing when you're running it under screen? It looks like vim _is_ still sending the clear-screen codes in screen_new_1.txt (which is why it's still working)... what's different? *Interesting*. Under screen, the terminal is screen-bce. Under tmux, it's screen. Although, this still doesn't explain why your earlier tests were sending the proper clear sequences even under tmux (though they weren't having the desired effect). -- Micah J. Cowan http://micah.cowan.name/ -- What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Wrong key stops program execution?
On 05/11/2011 07:32 PM, Nicolas Bigaouette wrote: Hi all, I'm using tmux to launch long simulations. It has served me well. On some systems, I have set ctrl+a as the main key, while on others it's ctrl+s. So to detach from tmux it should be either ctrl+a,d or ctrl+s,d. Unfortunately, I sometimes hit the wrong keyboard combination to detach. For example, I hit ctrl+s instead of ctrl+a. ... How can I re-start the process? Those simulations are really long so I can't just cancel it and re-launch it... Ctrl+s is used by terminals for the scroll lock feature. Ctrl+q is what unlocks it. If you don't desire it, it might be a good idea to put stty -ixon -ixoff in your .bashrc (or what have you). -- Micah J. Cowan http://micah.cowan.name/ -- Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters. http://p.sf.net/sfu/intel-dev2devmay ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: selection gets cleared when cursors blinks
On 04/20/2011 12:49 AM, LEVAI Daniel wrote: On Mon, Apr 18, 2011 at 20:14:09 +0100, Nicholas Marriott wrote: if you like you can run tmux in script(1) There is not much to see: The key words being run _tmux_ in script. You obviously didn't, or we'd be seeing status draws. And then attach the typescript, not copy/paste; you're liable to lose data that way. Personally, I'd be much more interested in running something like: bash -c 'sleep 20; echo foo' then making a selection, then waiting for that background command to print, and seeing if it clears the selection. If it does, then there is truly nothing tmux can do (not that it's likely that there's something tmux can do if it doesn't). If it doesn't clear it, there's an outside chance that there's some escape sequence that triggers it, and that isn't actually necessary to drawing the status. This is unlikely, but if true it's possible we might find a workaround. But as I've said before, the problem is with the host term; you're liable to have better luck with those folks (or perhaps by updating to a more recent version). -- Micah J. Cowan http://micah.cowan.name/ -- Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Wandering selection
(04/19/2011 05:09 AM), hubert depesz lubaczewski wrote: hi, have tmux (1.4), and following problem: My tmux is split into 3 panes, like this: ++ || ++ || ++ || || || || || || || ++ panes 1 and 2 (from the top) have tail -f some/log/file | colorizing the bottom pane is irc. when I select something in irc (lowest pane), and leave the selection there, sometimes - not always, when new thing gets shown in panes 1 or 2, the selection gets moved upwards 1 line. i.e. the text in irc window is the same, and selection has the same shape, but is one line higher. unfortunately it doesn't happen always, just sometimes, so it's hard for me to produce self-contained example, but perhaps you will know what can cause this problem. I'll hazard a guess that it's related to scroll regions, and that konsole accidentally scrolls the selection, even when the selection's not part of the scroll region. If that's the case, then I suspect you may find it easier to reproduce the problem by hitting Enter enough times that the prompt is at the bottom of the pane, and then hit Enter another time to get a scroll to trigger. -- HTH, Micah J. Cowan http://micah.cowan.name/ -- Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: selection gets cleared when cursors blinks
On 04/18/2011 01:19 AM, LEVAI Daniel wrote: On Wed, Feb 02, 2011 at 11:06:14AM +0100, LEVAI Daniel wrote: On Tue, Feb 01, 2011 at 20:05:40 +, Nicholas Marriott wrote: Are you sure it happens when the cursor blinks? If you make the cursor steady does it stop happening? What if you increase status-interval in tmux? Sorry, yes, you're absolutely right. It has nothing to do with cursor blinking, it does it in every second (I got confused, because the blinking happens in every second too). And yes, the status-interval option is responsible for this. I had it set to 1 second. When I increased it, the selection stayed for the interval. someone reported this before but we didn't track down what tmux does that triggers it also i can't reproduce with xterm Any chance of getting this fixed? It's a really annoying phenomena. Since this is a behavior of your terminal (kills the selection as soon as the term is written to), rather than tmux, I believe your choices are: 1) Increase your status-interval high enough that it happens rarely 2) Use a terminal that doesn't produce this behavior (or find configuration settings that may suppress it?) 3) Use copy mode, and some utility that allows you to transfer tmux's buffer to your system's paste buffer. -- Micah J. Cowan http://micah.cowan.name/ -- Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Italics in tmux
(04/09/2011 09:52 AM), Tiago Resende wrote: OK, now this is embarrassing. This time I got it right, I swear. Still a bit wrong, I'm afraid :\ $ infocmp $screen_terminfo | sed \ -e 's/^screen[^|]*\|[^,]*,/screen-it|screen with italics support,/' The \| above should be |. In GNU sed at least, \| is an alternation character (equivalent to | in EREs), and so this snippet prepends stuff to _every_ line (in other seds, its behavior may vary, but isn't defined by any standard). (Seb on the IRC chan pointed this out.) -- Micah J. Cowan http://micah.cowan.name/ -- Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: tmux refusing to do utf8
(04/14/2011 03:59 PM), Robin Lee Powell wrote: I did that, and greated a new window, and set -w utf8 returns off, and after doing set -w utf8 on it still returns off. Well, it should, shouldn't it? set -w utf8 doesn't mean show the value of the utf8 setting, it means toggle the value of the utf8 setting. -- Micah J. Cowan http://micah.cowan.name/ -- Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Meta keys issues
On 03/25/2011 10:49 AM, Paul Grove wrote: 1. Ran xterm 2. Checked my $TERM was equal to 'xterm' 3. Checked my Ctrl-Arrow keys - they worked 4. Ran tmux (from within xterm) 5. Checked my $TERM was equal to 'screen' 6. Checked my Ctrl-Arrow keys - they dont work Incidently, the same experiment, when done with screen instead of tmux, screen also fails to work correctly until TERM=xterm, at which point all 3 modify keys including Alt start working! I think there are several problems for modified arrow keys. The biggest problem is that there's no standardized way to tell apps what most modified arrow-key combinations are. For instance, vim and some other apps just figure out what the control-arrow keys are by using special magic when they see the word xterm or rxvt in the beginning of the TERM name. Of course, this isn't very fair to other terms that aren't one of those. ncurses supports extended entries, which uses kUP5=... to specify what control-up should look like. However, I don't know what apps actually use that. Tmux itself does, which is why it's possible to bind C-Up to a command in tmux. Tmux doesn't pass these sequences through directly, though; it translates them. Screen passes them as-is, ignoring them completely. This lets apps work with them if TERM=xterm (but that breaks other things: screen.xterm-free86 is much better, but wouldn't handle 256-color support. I don't think there's a stock terminfo anywhere that offers an entry that has both 256-color and control-modified arrow keys in one place; you'd have to make the entry yourself). There's no entry that lets you do this for tmux, either, but you could create one. I played around with doing so for a bit; the trouble, though, is that I couldn't find an app that would respect the new definition, apart from a nested tmux (running a different session). So, the answer would appear to be that there is nothing portable you can do across all apps. I'm not even sure vim can be told to work with tmux's control-modified arrow sequences, since vim's support appears to be specific to xterm-style arrow sequences (think it supports rxvt-style ones too). -- Micah J. Cowan http://micah.cowan.name/ -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Quick pane switching in true text console?
(03/24/2011 01:51 AM), Walter Dnes wrote: IANACP (I Am Not A C Programmer), so I'm not certain of this, but {ScrollLock} is the only one of the three that is normal. I.e. pressing it generates a one-byte scancode and releasing it generates that one-byte scancode + 0x80. Is there a way to bind a key by referring to its scancode, rather than to its ASCII output? It isn't. If the terminal doesn't send something for the key (which you would've seen in cat), then tmux can't see it. -- Micah J. Cowan http://micah.cowan.name/ -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Mouse in Vim
(03/24/2011 10:58 AM), Paul Grove wrote: Does anyone know the correct config to get the mouse to behave correctly in Vim? so far I have been have to get visual mode to work, but cannot drag the splits between buffers. Probably need to put ttymouse=xterm2 in your .vimrc. -- HTH, Micah J. Cowan http://micah.cowan.name/ -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: resize-pane keystrokes acting as select-pane
On 03/23/2011 11:50 AM, Nicholas Marriott wrote: These are usually the keys that are changed when the keypad is put into cursor mode, these are all treated as up, down, left and right by tmux. Try eg set -g terminal-overrides '*:kUP5=\eOA' That should be \e[OA shouldn't it? -- Micah J. Cowan http://micah.cowan.name/ -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: resize-pane keystrokes acting as select-pane
On 03/23/2011 11:43 AM, mbm329 wrote: Thanks for the pointer. Using PuTTY, here's the output: $ cat ^[[A ^[OA A How about for: tput smkx; cat; tput rmkx? That'd be the situation tmux would actually see them in. -- Micah J. Cowan http://micah.cowan.name/ -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: tmux: open terminal failed: missing or unsuitable terminal: xterm
On 03/04/2011 05:22 AM, Vaibhav Bedia wrote: Setting TERMINFO manually to /usr/share/terminfo worked. My suspicion is that the ncurses you linked against with tmux 1.4, has the wrong set of default paths to search, while the one you linked against with 1.3 had the right ones. Was probably a configure-time option to ncurses. To verify this, run strings path | grep /usr/share/terminfo on both of the ncurses library files, and see whether you get any results for the new one. If not, you may have to rebuild/obtain a new copy of your ncurses; one with the right search paths (or you could just set TERMINFO in your exports permanently, which is probably easier). However i have a really strange observation. I just exported TERMINFO variable and then launched a tmux session. Then i detached from it and logged out from the server i was working on. When i again log in i again check TERMINFO and its not set to anything (since i just did an export earlier). But now i can reattach to the session i had invoked earlier. Yeah, as I said before, setting TERMINFO only matters to the server. This is because it's the server that does all the work; the clients do almost nothing, other than tell the server where to draw things to (and what the name of the terminal is, and other environment settings). So, it's the server that does terminal name lookups in ncurses, which is affected by its own true environment settings with regard to TERMINFO. So once the server is started with a proper TERMINFO, you're good to go (as long as there does exist a terminfo entry for whatever the client's TERM is set to when it attaches). -- Micah J. Cowan http://micah.cowan.name/ -- What You Don't Know About Data Connectivity CAN Hurt You This paper provides an overview of data connectivity, details its effect on application quality, and explores various alternative solutions. http://p.sf.net/sfu/progress-d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Pane-switching with mouse busted?
(03/04/2011 08:53 AM), Kevin Goodsell wrote: You're not using a very wide window by any chance, are you? The mouse-position encoding scheme only supports a limited number of columns, and people with high-resolution monitors have been running into the limitation. This would make the right side of the screen not respond to mouse clicks. Good catch, i'd forgotten about that; that seems to be the problem (161 columns). Strange, I've always used a 161-column term (for side-by-side 80-col panes), but don't recall running into it before. I thought we were using the xterm-style (longer-reaching) codes now in CVS? I suppose that might be only when the underlying app specifically asks for it, or something? Is there a way to enable them? -- Micah J. Cowan http://micah.cowan.name/ -- What You Don't Know About Data Connectivity CAN Hurt You This paper provides an overview of data connectivity, details its effect on application quality, and explores various alternative solutions. http://p.sf.net/sfu/progress-d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Pane-switching with mouse busted?
(03/04/2011 11:29 AM), Micah Cowan wrote: (03/04/2011 11:19 AM), Kevin Goodsell wrote: It looks like 94 would be the limit for applications that are expecting the old mouse tracking with a terminal that is reporting extended mouse tracking. The two modes are compatible up to that point. Yeah, that's what I got from a little further reading too. Sure it does. VTE supports any of the mouse protocols that xterm does. Anyway, just tried xterm (new tmux server/socket), got the same problem. OK. As far as I can tell, gnome-terminal doesn't seem to respond to the extended mouse mode control sequences (\E[?1005h and \E[?1005l), or at least I can't see any change in its behavior. However, it is sending some strange stuff beyond column 94 when I put it in 1000 or 1002 mode, presumably using the extended protocol. Hm. Well, I'm getting no better behavior even if I set -g mouse-utf8 off, or even setw -g utf8 off. Found the bug, committed a very simple fix to SF. Should be quite self-explanatory. Part of the problem I encountered during debug-time was also that tmux set -g mouse-utf8 off doesn't work if the socket isn't default (it sets the value in default instead). It used to check $TMUX for where to connect (I fixed it to do so some time back, guess it's broken again). Thanks for helping with this! -- Micah J. Cowan http://micah.cowan.name/ -- What You Don't Know About Data Connectivity CAN Hurt You This paper provides an overview of data connectivity, details its effect on application quality, and explores various alternative solutions. http://p.sf.net/sfu/progress-d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Pane-switching with mouse busted?
(03/04/2011 12:39 PM), Micah Cowan wrote: Part of the problem I encountered during debug-time was also that tmux set -g mouse-utf8 off doesn't work if the socket isn't default (it sets the value in default instead). It used to check $TMUX for where to connect (I fixed it to do so some time back, guess it's broken again). (This should be fixed now too.) -- Micah J. Cowan http://micah.cowan.name/ -- What You Don't Know About Data Connectivity CAN Hurt You This paper provides an overview of data connectivity, details its effect on application quality, and explores various alternative solutions. http://p.sf.net/sfu/progress-d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: tmux: open terminal failed: missing or unsuitable terminal: xterm
(03/02/2011 09:10 PM), Vaibhav Bedia wrote: Hi, I am using tmux-1.4. I just started getting the error (open terminal failed: missing or unsuitable terminal: xterm) when trying to attach to a pre-existing session. That error message would indicate that a terminfo database entry can't be found for xterm. Make sure that TERMINFO isn't set (or else, explicitly set it to where it should be able to find its terminfo database). If setting it explicitly has a positive effect, then perhaps your tmux 1.4 was built with a different idea of where terminfo stuff should be, than tmux 1.3 was. Were they built/linked against different versions of ncurses? Was tmux 1.4 obtained or built using different means than tmux 1.3 was? In addition to playing with TERMINFO, you might also try copying /usr/share/terminfo/x/* (or wherever it is) into ~/.terminfo/x/. Good paths to try for TERMINFO include /etc/terminfo, /lib/terminfo, and /usr/share/terminfo. Find out which one has an x/xterm in it and set it to that. If any of these tricks work, then the next step would be to find out why it's not looking at that place by default. BTW, in order for the TERMINFO trick to work, it has to be set in the _server_'s environment, not the client's, so be sure to completely kill and restart tmux (with the new environment setting) when you try it (setting it for just a client WON'T work). -- HTH, Micah J. Cowan http://micah.cowan.name/ -- Free Software Download: Index, Search Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Freezing the input state machine
You can also type (say) echo -e '\e\\' blindly. You're still getting a prompt, it's just being sent to the window title, like everything else. \e\\ (and its equivalent \e]0;) is a pretty special case, though, I doubt there are other sequences that can freeze up the term so solidly. They're special since they have to accept virtually every character that follows as a valid part of the sequence, until they see the expected terminator. With most other sequences, hitting a few random keys is likely to break you out. -mjc On 01/25/2011 02:28 PM, Nicholas Marriott wrote: Oh and you can also get the pty /dev node from tmux info and send a \033 to it :-). On Tue, Jan 25, 2011 at 10:24:57PM +, Nicholas Marriott wrote: Well, it doesn't really freeze tmux, it input from one pane. We used to abort the sequence when the buffer was full but now we have INPUT_DISCARD. Could get rid of that but it would need some way to throw a state change back up. You can do it if you like but if not IMO it is enough to say don't do that then. gnome-terminal is not a good implementation to model behaviour from, how xterm handles it is usually the right way. Cheers On Tue, Jan 25, 2011 at 02:11:00PM -0800, Kevin Goodsell wrote: I've noticed that tmux can be frozen by doing something like this: $ echo -e '\e_' This probably shouldn't be much of a surprise given the definition of the state machine used in input.c, and maybe it's considered OK. A quick test show that xterm also has this problem, but VTE (gnome-terminal) doesn't. I wanted to call attention to this in case it is cause for concern. In case it's not clear what is happening when it is frozen, sending a prefix for certain states will cause the terminal to remain in that state until a termination sequence (usually just anything beginning with ESC) is encountered in the input. The lack of a shell prompt makes it impossible (or not?) to send anything to the input stream to cause a return to the default state. -Kevin -- Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users -- Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users -- Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users -- Micah J. Cowan http://micah.cowan.name/ -- Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: tmux config: cannot bind -t vi-copy C-PPage
(01/24/2011 02:41 PM), clemens fischer wrote: On Tue-2011/01/18-21:47 clemens fischer wrote in gmane.comp.terminal-emulators.tmux.user (MID srah08xli6@nntp.spotteswoode.dnsalias.org): tmux github version from today (the master branch), on Linux 2.6.36.3-spott i686 and rxvt-unicode-256color-9.07-10. I have the following lines in $HOME/.tmux.conf: bind-key -t vi-copy C-PPage page-up bind-key -t vi-copy C-NPage page-down bind-key -t vi-copy C-Up page-up bind-key -t vi-copy C-Down page-down I need them because repeatedly doing PPage doesn't bring me up, I need that prefix to get higher. Tmux complains: usage: bind-key [-cnr] [-t key-table] key command [arguments] Just wanted to ask: can someone reproduce this? If it's the bug I think it is, and especially if it had been working at one point and then ceased working, then try again with the latest CVS, should be fixed in cmd-bind-key.c 1.31. -- Micah J. Cowan http://micah.cowan.name/ -- Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Passing escape sequences to the underlying terminal
(01/21/2011 12:38 PM), Nicholas Marriott wrote: Perhaps from Screen, where it has the same effect as OSC 0, 1 and 2. Probably. Don't see any harm in nuking it anyway if necessary. I do. I'm pretty sure that there are at least a few people depending on this behavior, and sticking with a simple does TERM == 'screen'? test to toggle it on... I saw this yesterday on IRC (I'm assuming it was Chris Poole, since it was the same issue, same shell), though in that particular case it was unintended (Chris is trying to prevent window renaming). Even after removing the bit that we found doing that, Chris was still having the problem (which is why he posted on the list), so perhaps the same logic is found in a different file that gets run on shell start, or something... or perhaps he didn't remove it as cleanly as he thought :) I don't know whether other people are intentionally using this screen-alike feature, but it seems rash to remove it if there are other means available... -- Micah J. Cowan http://micah.cowan.name/ -- Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Send a reset?
On 12/23/2010 11:11 AM, Nicholas Marriott wrote: You mean a command to make like the output came from the application inside tmux? Yes, exactly! :) -- Micah J. Cowan http://micah.cowan.name/ -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Send a reset?
(12/21/2010 11:27 AM), Dan Tulovsky wrote: Is there a way to send a Reset in tmux? Sometimes (for example, when using serial consoles) the terminal gets screwed up and the only way to fix it is to reset it. This is cmd+R in Terminal on the Mac. I think it's just C-a r in screen. Default binding is prefix r in tmux as well (see the manpage for refresh-client). -- Micah J. Cowan http://micah.cowan.name/ -- Forrester recently released a report on the Return on Investment (ROI) of Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even within 7 months. Over 3 million businesses have gone Google with Google Apps: an online email calendar, and document program that's accessible from your browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Send a reset?
(12/21/2010 12:26 PM), Dan Tulovsky wrote: Hmm.. so I mapped it back to the default, but it doesn't actually work. As far as I can tell, nothing happens. The currently broken terminal (after a reboot via serial console of the remote server) is not scrolling. All output is on the very last line and stays there. C-b ? shows r: refresh-client I've also tried typing it in as a command: C-b : : refresh-client same story. any ideas? Maybe I misunderstood what you wanted... refresh-client simply redraws the screen; but maybe you wanted to reset a pane's state to it's initial settings, (like running the command-line reset command; also, screen's C-a r doesn't do a reset or a refresh, it toggles screen's linewrap settings). If you want reset-command like behavior, screen uses C-a Z for that. I don't actually know of a way to do it in tmux, though. If you can find out the tty file for that pane, then you could issue the shell command (perhaps via tmux's run-shell command): tmux -Tscreen reset /dev/pts/FOO -- Micah J. Cowan http://micah.cowan.name/ -- Forrester recently released a report on the Return on Investment (ROI) of Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even within 7 months. Over 3 million businesses have gone Google with Google Apps: an online email calendar, and document program that's accessible from your browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: tmux on linux fb console is unresponsive
(12/07/2010 03:11 PM), Nicholas Marriott wrote: Hi What tmux version? What is TERM set to outside tmux in the console? Probably need the version of your libevent, too. -- Micah J. Cowan http://micah.cowan.name/ -- What happens now with your Lotus Notes apps - do you make another costly upgrade, or settle for being marooned without product support? Time to move off Lotus Notes and onto the cloud with Force.com, apps are easier to build, use, and manage than apps on traditional platforms. Sign up for the Lotus Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
even layouts not quite even.
Currently, even-horizontal will split a 161-column terminal into 79 and 81, rather than 80/80; and even-vertical will split 44 lines into 20 and 22. The attached patch fixes this. Let me know if it looks alright, and I'll commit it. I noticed the default value for main-pane-width is set to 81, which seems an odd value for me; why isn't it the more usual 80? -- Micah J. Cowan http://micah.cowan.name/ Index: sf/layout-set.c === --- sf.orig/layout-set.c 2010-12-02 20:33:38.93560 -0800 +++ sf/layout-set.c 2010-12-02 20:39:31.80360 -0800 @@ -135,10 +135,9 @@ layout_set_even_h(struct window *w) return; /* How many can we fit? */ - if (w-sx / n PANE_MINIMUM + 1) + width = (w-sx - (n-1)) / n; + if (width PANE_MINIMUM + 1) width = PANE_MINIMUM + 1; - else - width = w-sx / n; /* Free the old root and construct a new. */ layout_free(w); @@ -151,12 +150,12 @@ layout_set_even_h(struct window *w) TAILQ_FOREACH(wp, w-panes, entry) { /* Create child cell. */ lcnew = layout_create_cell(lc); - layout_set_size(lcnew, width - 1, w-sy, xoff, 0); + layout_set_size(lcnew, width, w-sy, xoff, 0); layout_make_leaf(lcnew, wp); TAILQ_INSERT_TAIL(lc-cells, lcnew, entry); i++; - xoff += width; + xoff += width + 1; } /* Allocate any remaining space. */ @@ -189,10 +188,9 @@ layout_set_even_v(struct window *w) return; /* How many can we fit? */ - if (w-sy / n PANE_MINIMUM + 1) + height = (w-sy - (n-1)) / n + if (height PANE_MINIMUM + 1) height = PANE_MINIMUM + 1; - else - height = w-sy / n; /* Free the old root and construct a new. */ layout_free(w); @@ -205,12 +203,12 @@ layout_set_even_v(struct window *w) TAILQ_FOREACH(wp, w-panes, entry) { /* Create child cell. */ lcnew = layout_create_cell(lc); - layout_set_size(lcnew, w-sx, height - 1, 0, yoff); + layout_set_size(lcnew, w-sx, height, 0, yoff); layout_make_leaf(lcnew, wp); TAILQ_INSERT_TAIL(lc-cells, lcnew, entry); i++; - yoff += height; + yoff += height + 1; } /* Allocate any remaining space. */ -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: make pane full screen
On 06/09/2010 12:00 PM, Tomasz Pajor wrote: Hello, I got window split to 3 panes. Is there a way to make current pane full screen, and after i finish working with it, bring it back to the previous size? break-pane (prefix !) followed by join-pane get me approximately similar behavior. For the join-pane I have the following binding set up in my .tmux.conf: bind-key j command-prompt -p 'join with:' 'join-pane -h -t %%' (Most of the time you can use just the window number; however sometimes you have to be explicit and specify the pane number; I run into this most often when trying to join with window 0 - there is always a pane 0 in the current window so you have to specify window 0.0 to get pane 0 of window 0, instead of pane 0 of the current window) If it joins on the wrong side of the pane, just use prefix { or } to swap panes. -- HTH, Micah J. Cowan http://micah.cowan.name/ -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: tmux as login shell without chsh
clemens fischer wrote: On Sun-2010/02/28-21:28 Nicholas Marriott wrote: You probably want to exec tmux new-session, or use tmux new-session -d instead. I always use exec /usr/local/bin/tmux ${TMUX_OPTIONS} attach-session without checking for existing sessions on the local machine. If there is one, it attaches to it, if not, it makes a new one. No it doesn't, unless you're explicitly doing new-session in your .tmux.conf (which, however, is a good idea, as it lets you use new-window commands and the like afterwards in your .tmux.conf). But if he doesn't have new-session in his .tmux.conf, this won't work. -- Micah J. Cowan http://micah.cowan.name/ -- ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
tmux_1.2-0 debian package
I created a Debian source package for tmux 1.2, for those who are interested. There's also a .deb for i386. http://micah.cowan.name/tmux-debs/ -- Micah J. Cowan http://micah.cowan.name/ -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: set -g status-bg colour?
tilde wrote: Simple question: someone knows where i can find a list of colors code indexed 0-255? I can't find it anywhere! or maybe an alternative to this for say tmux how to set the color I want? There's tools/256colors.pl in the tmux source tree. It doesn't give the indexes, but studying the sources was illuminating (at least, to me). I also whipped up a small shell script to help me find color values I like. I've attached it here. -- Micah J. Cowan http://micah.cowan.name/ #! /bin/bash main() { echo Enter a color number to get a sample and translation, echo 'g' and 0-23 for grey, or 'c' and three numbers 0-5 for color. echo -n ' ' while read line do case $line in 'g '*) handle_grey ${line#'g '} ;; 'c '*) handle_color ${line#'c '} ;; *) handle_code $line ;; esac echo -n ' ' done echo } handle_grey() { num=$1 if test $num -gt 23 then echo '$num' isn't between 0 and 23. else code=$(( num + 232 )) tput setaf $code echo Grey '$num' is $code. tput sgr0 fi } handle_color() { set -- $1 r=$1 ; g=$2 ; b=$3 for c in $r $g $b do if test $c -gt 5 then echo 'Must be between 0 and 5.' return fi done code=$(( 16 + 36 * r + 6 * g + b )) tput setaf $code echo rgb($r/$g/$b) is $code. tput sgr0 } handle_code() { code=$1 tput setaf $code echo -n Color number $code is if test $code -lt 16 then adjust=$code if test $code -eq 0 then echo 'grey.' else if test $code -ge 9 then echo -n ' light' adjust=$(( code - 8 )) fi case $adjust in 0) echo ' black.' ;; 1) echo ' red.' ;; 2) echo ' green.' ;; 3) echo ' yellow.' ;; 4) echo ' blue.' ;; 5) echo ' turquoise.' ;; 6) echo ' magenta.' ;; 7) echo ' white.' ;; esac fi elif test $code -lt 232 then adjust=$(( code - 16 )) echo rgb($(( adjust / 36 ))/$(( adjust % 36 / 6 ))/$(( adjust % 6 ))). else echo grey shade $(( code - 232 )). fi tput sgr0 } main -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: set -g status-bg colour?
trapd...@trapd00r.se wrote: On 12/03/10 02:49 +, Nicholas Marriott wrote: This one shows the numbers too: That was nice. Anyone know how those could be used like we use regular colors; i.e echo \033[32m foo in an 256-color-capable terminal? Read the source for those scripts? They're very straightforward. The one Nicholas sent actually has the correct sequences in-line as part of the source-code (so use an editor that will display them, and not render them). -- Micah J. Cowan http://micah.cowan.name/ -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: How to checkout the latest source code
Trent W. Buck wrote: Nicholas Marriott nicholas.marri...@gmail.com writes: OpenBSD is the primary repository at the moment because it is easier for me, SF is sync'd up fairly often by tcunha. Do you have any plans to switch to a different VCS (e.g. git, svn) for the primary repo? He doesn't. But Thomas Adams keeps a git repo sync'd from the SF CVS: http://github.com/ThomasAdam/tmux -- Micah J. Cowan http://micah.cowan.name/ -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Setting the pane (window?) title
Trent W. Buck wrote: It seems that tmux is more clever than I am. I open a new window (running bash). Therein, I run emacs -Q -f ielm. At this point, tmux says the title is emacs. Good! Now, I attempt to have emacs set the window title to something more meaningful than emacs, such as the name of the file being edited. ELISP (send-string-to-terminal \ekEĥoŝanĝo ĉiuĵaŭde, Γειά σας, שלום, Здравствуйте!\e\\) nil ELISP Hooray, it worked. And unlike Screen, it got Unicode right! But wait; after less than a second, something has set the window title back to emacs. This is not what I want! My bash PS1 includes the Screen shelltitle escape sequence (case $TERM in (screen*) PS1=\[\134\033k\033\134\015\]$PS1;; esac) so I tried tmux neww emacs -Q -f ielm but the new window exhibited the same behaviour. Yeah, tmux's automatic renaming doesn't rely on those escape sequences (it supports them - not sure about the magic empty one from above, though); instead, it relies on OS-specific means to determine the name of the foreground process on the tty. You can turn off the automatic retitling on a particular window with the set-w automatic-rename off command; to disable it in the global settings, add -g. Renaming a window manually will also disable the automatic renaming. -- Micah J. Cowan http://micah.cowan.name/ -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: [Patch] Re: copy rectangle with short lines
clemens fischer wrote: High quality indeed, and works as expected! Thank you very much, Micah! One question: it applied with offsets to portable HEAD from yesterday: snip How come? I wrote it to apply after the last couple patches I'd recently submitted. I figured it would apply without them, so didn't mention it. -- Micah J. Cowan http://micah.cowan.name/ -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: copy rectangle with short lines
Robin Lee Powell wrote: On Thu, Feb 18, 2010 at 01:39:15PM -0800, Micah Cowan wrote: The following should bind prefix J to join the current (already finished) selection with spaces: bind-key J run-shell 'tmux save-buffer /tmp/.tmux-exchange; tr \n /tmp/.tmux-exchange /tmp/.tmux-exchange-processed; tmux load-buffer /tmp/.tmux-exchange-processed' Oh *interesting*; I thought code was going to be required. Yeah, I did too, until I realized (quoted from your other post): micahcowan rlpowell, you could get around that nonblocking run-shell thing, actually: just use tmux save-buffer, etc, in the shell command, rather than doing it as a direct tmux command. ... Still seems like it might be nice to clean that up a bit, but good stuff none the less. You could farm the whole thing out to a shell script with the same A content. Now we just need the rotating behaviour of J (see my other post). Well, you could of course still rig that up through run-shell, and some sort of flag-file. But personally, I don't like the rotating behavior of J: better to have separate bindings for separate modes, so you only have to hit the binding once to get the behavior you want (and don't have to figure out what mode you're already in). The shell solution strikes me as the most flexible solution, since there are many things you just wouldn't think to hardcode -- Micah J. Cowan http://micah.cowan.name/ -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: copy rectangle with short lines
clemens fischer wrote: clemens fischer wrote: I am very glad that tmux has rectangular copies now! But a problem as well: in the following, try to cut out the block bbb from aaa bbb y xxx y 22 111 22 At least in vi-copy mode on linux, the shortest line determines the right border of the block. I noticed too late that this problem has been adressed and possibly fixed in: Micah Cowan: [Patch] BUG: clipped copies on wrapped lines Message-ID: 4b7ae24e.6020...@cowan.name Archived-At: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/328 That's actually an unrelated fix, with a deceptively similar description. My fix is that, if you copy text from a line that is wrapped (but don't include the wrap itself as part of the selection), tmux was stripping off the last character. That's different from what you want (but see my other post for a description of a possible fix). -- Micah J. Cowan http://micah.cowan.name/ -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[Patch] Re: copy rectangle with short lines
clemens fischer wrote: Hi, I am very glad that tmux has rectangular copies now! But a problem as well: in the following, try to cut out the block bbb from aaa bbb y xxx y 22 111 22 At least in vi-copy mode on linux, the shortest line determines the right border of the block. Here's a patch to solve this one. -- Micah J. Cowan http://micah.cowan.name/ Index: sf/window-copy.c === --- sf.orig/window-copy.c 2010-02-18 17:19:20.0 -0800 +++ sf/window-copy.c 2010-02-18 18:06:21.0 -0800 @@ -53,6 +53,7 @@ void window_copy_update_cursor(struct wi void window_copy_start_selection(struct window_pane *); int window_copy_update_selection(struct window_pane *); void window_copy_copy_selection(struct window_pane *, struct client *); +void window_copy_clear_selection(struct window_pane *); void window_copy_copy_line( struct window_pane *, char **, size_t *, u_int, u_int, u_int); int window_copy_in_set(struct window_pane *, u_int, u_int, const char *); @@ -223,7 +224,7 @@ window_copy_resize(struct window_pane *w if (data-cx sx) data-cx = sx; - screen_clear_selection(data-screen); + window_copy_clear_selection(wp); screen_write_start(ctx, NULL, s); window_copy_write_lines(wp, ctx, 0, screen_size_y(s) - 1); @@ -378,7 +379,7 @@ window_copy_key(struct window_pane *wp, window_copy_redraw_screen(wp); break; case MODEKEYCOPY_CLEARSELECTION: - screen_clear_selection(data-screen); + window_copy_clear_selection(wp); window_copy_redraw_screen(wp); break; case MODEKEYCOPY_COPYSELECTION: @@ -1211,6 +1212,20 @@ window_copy_copy_line(struct window_pane } } +void +window_copy_clear_selection(struct window_pane *wp) +{ + struct window_copy_mode_data *data = wp-modedata; + u_intpx, py; + + screen_clear_selection(data-screen); + + py = screen_hsize(wp-base) + data-cy - data-oy; + px = window_copy_find_length(wp, py); + if (data-cx px) + window_copy_update_cursor(wp, px, data-cy); +} + int window_copy_in_set(struct window_pane *wp, u_int px, u_int py, const char *set) { @@ -1320,8 +1335,12 @@ window_copy_cursor_right(struct window_p struct window_copy_mode_data *data = wp-modedata; u_int px, py; - py = screen_hsize(wp-base) + data-cy - data-oy; - px = window_copy_find_length(wp, py); + if (data-screen.sel.flag data-rectflag) + px = screen_size_x(data-screen); + else { + py = screen_hsize(wp-base) + data-cy - data-oy; + px = window_copy_find_length(wp, py); + } if (data-cx = px) { window_copy_cursor_start_of_line(wp); @@ -1366,10 +1385,12 @@ window_copy_cursor_up(struct window_pane } } - py = screen_hsize(wp-base) + data-cy - data-oy; - px = window_copy_find_length(wp, py); - if (data-cx = data-lastsx || data-cx px) - window_copy_cursor_end_of_line(wp); + if (!data-screen.sel.flag || !data-rectflag) { + py = screen_hsize(wp-base) + data-cy - data-oy; + px = window_copy_find_length(wp, py); + if (data-cx = data-lastsx || data-cx px) + window_copy_cursor_end_of_line(wp); + } } void @@ -1397,10 +1418,12 @@ window_copy_cursor_down(struct window_pa window_copy_redraw_lines(wp, data-cy - 1, 2); } - py = screen_hsize(wp-base) + data-cy - data-oy; - px = window_copy_find_length(wp, py); - if (data-cx = data-lastsx || data-cx px) - window_copy_cursor_end_of_line(wp); + if (!data-screen.sel.flag || !data-rectflag) { + py = screen_hsize(wp-base) + data-cy - data-oy; + px = window_copy_find_length(wp, py); + if (data-cx = data-lastsx || data-cx px) + window_copy_cursor_end_of_line(wp); + } } void @@ -1648,9 +1671,15 @@ void window_copy_rectangle_toggle(struct window_pane *wp) { struct window_copy_mode_data *data = wp-modedata; + u_int px, py; data-rectflag = !data-rectflag; + py = screen_hsize(wp-base) + data-cy - data-oy; + px = window_copy_find_length(wp, py); + if (data-cx px) + window_copy_update_cursor(wp, px, data-cy); + window_copy_update_selection(wp); window_copy_redraw_screen(wp); } -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[Patch] Typing end-of-line twice
Change (inspired by an IRC discussion with Nicholas): Typing the end-of-line key once will bring you to the end of the textual content of the current row on the screen. If the current row contains only a portion of a line had wrapped onto the next row, then typing the end-of-line key again will bring you to the end of the complete, wrapped line. When a rectangular selection is active, typing it the second time will bring you to the right edge of the screen (even if it's past the end of the line of text), and doesn't do anything special with wrapped lines. -- Micah J. Cowan http://micah.cowan.name/ Index: sf/window-copy.c === --- sf.orig/window-copy.c 2010-02-18 18:20:20.0 -0800 +++ sf/window-copy.c 2010-02-18 20:08:47.0 -0800 @@ -1304,12 +1304,28 @@ void window_copy_cursor_end_of_line(struct window_pane *wp) { struct window_copy_mode_data *data = wp-modedata; + struct screen *base_s = wp-base; + struct grid *gd = base_s-grid; u_int px, py; - py = screen_hsize(wp-base) + data-cy - data-oy; + py = screen_hsize(base_s) + data-cy - data-oy; px = window_copy_find_length(wp, py); + if (data-cx == px) { + if (data-screen.sel.flag data-rectflag) + px = screen_size_x(wp-base); + if (gd-linedata[py].flags GRID_LINE_WRAPPED) { + while (py gd-sy + gd-hsize + gd-linedata[py].flags GRID_LINE_WRAPPED) { +window_copy_cursor_down(wp, 0); +py = screen_hsize(wp-base) + + data-cy - data-oy; + } + px = window_copy_find_length(wp, py); + } + } window_copy_update_cursor(wp, px, data-cy); + if (window_copy_update_selection(wp)) window_copy_redraw_lines(wp, data-cy, 1); } @@ -1388,7 +1404,8 @@ window_copy_cursor_up(struct window_pane if (!data-screen.sel.flag || !data-rectflag) { py = screen_hsize(wp-base) + data-cy - data-oy; px = window_copy_find_length(wp, py); - if (data-cx = data-lastsx || data-cx px) + if ((data-cx = data-lastsx data-cx != px) + || data-cx px) window_copy_cursor_end_of_line(wp); } } @@ -1421,7 +1438,8 @@ window_copy_cursor_down(struct window_pa if (!data-screen.sel.flag || !data-rectflag) { py = screen_hsize(wp-base) + data-cy - data-oy; px = window_copy_find_length(wp, py); - if (data-cx = data-lastsx || data-cx px) + if ((data-cx = data-lastsx data-cx != px) + || data-cx px) window_copy_cursor_end_of_line(wp); } } Index: sf/tmux.1 === --- sf.orig/tmux.1 2010-02-18 20:12:34.0 -0800 +++ sf/tmux.1 2010-02-18 20:21:40.0 -0800 @@ -679,6 +679,15 @@ in emacs mode, and .Ql 10w in vi. .Pp +Typing the end-of-line key once will bring you to the end of the textual +content of the current row on the screen. +If the current row contains only a portion of a line had wrapped onto +the next row, then typing the end-of-line key again will bring you to +the end of the complete, wrapped line. +When a rectangular selection is active, typing it the second time will +bring you to the right edge of the screen (even if it's past the end of +the line of text), and doesn't do anything special with wrapped lines. +.Pp These key bindings are defined in a set of named tables: .Em vi-edit and -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Rebased diffs: word-separators and cmd-prefixes
Okay, these diffs have been rebased to before the copy-output-merge stuff (and to the latest OpenBSD changes), and reworked a bit. They should be applied in the order: word-separators, then cmd-prefixes. -- Micah J. Cowan http://micah.cowan.name/ Index: mode-key.c === --- mode-key.c.orig +++ mode-key.c @@ -106,6 +106,7 @@ struct mode_key_cmdstr mode_key_cmdstr_c { MODEKEYCOPY_SEARCHDOWN, search-forward }, { MODEKEYCOPY_SEARCHREVERSE, search-reverse }, { MODEKEYCOPY_SEARCHUP, search-backward }, + { MODEKEYCOPY_STARTNUMBERPREFIX, start-number-prefix }, { MODEKEYCOPY_STARTOFLINE, start-of-line }, { MODEKEYCOPY_STARTSELECTION, begin-selection }, { MODEKEYCOPY_TOPLINE, top-line }, @@ -178,6 +179,15 @@ const struct mode_key_entry mode_key_vi_ { '$', 0, MODEKEYCOPY_ENDOFLINE }, { '/', 0, MODEKEYCOPY_SEARCHDOWN }, { '0', 0, MODEKEYCOPY_STARTOFLINE }, + { '1', 0, MODEKEYCOPY_STARTNUMBERPREFIX }, + { '2', 0, MODEKEYCOPY_STARTNUMBERPREFIX }, + { '3', 0, MODEKEYCOPY_STARTNUMBERPREFIX }, + { '4', 0, MODEKEYCOPY_STARTNUMBERPREFIX }, + { '5', 0, MODEKEYCOPY_STARTNUMBERPREFIX }, + { '6', 0, MODEKEYCOPY_STARTNUMBERPREFIX }, + { '7', 0, MODEKEYCOPY_STARTNUMBERPREFIX }, + { '8', 0, MODEKEYCOPY_STARTNUMBERPREFIX }, + { '9', 0, MODEKEYCOPY_STARTNUMBERPREFIX }, { ':', 0, MODEKEYCOPY_GOTOLINE }, { '?', 0, MODEKEYCOPY_SEARCHUP }, { 'B', 0, MODEKEYCOPY_PREVIOUSSPACE }, @@ -280,6 +290,15 @@ struct mode_key_tree mode_key_tree_emacs /* emacs copy mode keys. */ const struct mode_key_entry mode_key_emacs_copy[] = { { ' ', 0, MODEKEYCOPY_NEXTPAGE }, + { '1' | KEYC_ESCAPE, 0, MODEKEYCOPY_STARTNUMBERPREFIX }, + { '2' | KEYC_ESCAPE, 0, MODEKEYCOPY_STARTNUMBERPREFIX }, + { '3' | KEYC_ESCAPE, 0, MODEKEYCOPY_STARTNUMBERPREFIX }, + { '4' | KEYC_ESCAPE, 0, MODEKEYCOPY_STARTNUMBERPREFIX }, + { '5' | KEYC_ESCAPE, 0, MODEKEYCOPY_STARTNUMBERPREFIX }, + { '6' | KEYC_ESCAPE, 0, MODEKEYCOPY_STARTNUMBERPREFIX }, + { '7' | KEYC_ESCAPE, 0, MODEKEYCOPY_STARTNUMBERPREFIX }, + { '8' | KEYC_ESCAPE, 0, MODEKEYCOPY_STARTNUMBERPREFIX }, + { '9' | KEYC_ESCAPE, 0, MODEKEYCOPY_STARTNUMBERPREFIX }, { '' | KEYC_ESCAPE,0, MODEKEYCOPY_HISTORYTOP }, { '' | KEYC_ESCAPE,0, MODEKEYCOPY_HISTORYBOTTOM }, { 'R' | KEYC_ESCAPE, 0, MODEKEYCOPY_TOPLINE }, Index: tmux.h === --- tmux.h.orig +++ tmux.h @@ -476,6 +476,7 @@ enum mode_key_cmd { MODEKEYCOPY_SEARCHDOWN, MODEKEYCOPY_SEARCHREVERSE, MODEKEYCOPY_SEARCHUP, + MODEKEYCOPY_STARTNUMBERPREFIX, MODEKEYCOPY_STARTOFLINE, MODEKEYCOPY_STARTSELECTION, MODEKEYCOPY_TOPLINE, Index: window-copy.c === --- window-copy.c.orig +++ window-copy.c @@ -28,6 +28,7 @@ void window_copy_free(struct window_pane void window_copy_resize(struct window_pane *, u_int, u_int); void window_copy_key(struct window_pane *, struct client *, int); int window_copy_key_input(struct window_pane *, int); +int window_copy_key_numeric_prefix(struct window_pane *, int); void window_copy_mouse( struct window_pane *, struct client *, struct mouse_event *); @@ -81,6 +82,7 @@ const struct window_mode window_copy_mod enum window_copy_input_type { WINDOW_COPY_OFF, + WINDOW_COPY_NUMERICPREFIX, WINDOW_COPY_SEARCHUP, WINDOW_COPY_SEARCHDOWN, WINDOW_COPY_GOTOLINE, @@ -108,6 +110,8 @@ struct window_copy_mode_data { const char *inputprompt; char *inputstr; + u_int numprefix; + enum window_copy_input_type searchtype; char *searchstr; }; @@ -134,6 +138,7 @@ window_copy_init(struct window_pane *wp) data-inputtype = WINDOW_COPY_OFF; data-inputprompt = NULL; data-inputstr = xstrdup(); + data-numprefix = 0; data-searchtype = WINDOW_COPY_OFF; data-searchstr = NULL; @@ -222,11 +227,20 @@ window_copy_key(struct window_pane *wp, const char *word_separators; struct window_copy_mode_data *data = wp-modedata; struct screen *s = data-screen; - u_int n; + u_int n, np; int keys; enum mode_key_cmd cmd; - if (data-inputtype != WINDOW_COPY_OFF) { + np = data-numprefix; + if (np == 0) + np = 1; + + if (data-inputtype == WINDOW_COPY_NUMERICPREFIX) { + if (window_copy_key_numeric_prefix(wp, key) == 0) + return; + data-inputtype = WINDOW_COPY_OFF; + window_copy_redraw_lines(wp, screen_size_y(s) - 1, 1); + } else if (data-inputtype != WINDOW_COPY_OFF) { if (window_copy_key_input(wp, key) != 0) goto input_off; return; @@ -235,55 +249,69 @@ window_copy_key(struct window_pane *wp, cmd = mode_key_lookup(data-mdata, key); switch (cmd) { case MODEKEYCOPY_CANCEL: - window_pane_reset_mode(wp); + for (; np != 0; np--) + window_pane_reset_mode(wp); break; case MODEKEYCOPY_LEFT: - window_copy_cursor_left(wp); - return; + for (; np != 0; np--) + window_copy_cursor_left(wp); + break; case MODEKEYCOPY_RIGHT:
[Patch] jump-to-char
This patch introduces support for the quick jump-to-char commands from vi, for tmux's copy mode. They are bound to the same keys in both vi mode and emacs. This patch expects to be applied after the other two patches I recently rebased (cmd-prefixes and word-separators). The new bindings let you do: f charjump forward to the next char t charjump to just before the next char F charjump back to the previous char T charjump back to just after the prev char ; repeat the last jump command , repeat the last jump command, but reverse the direction This makes it extremely convenient to jump between, say, path components, or colon-separated PATH environment variables. It's also handy just for normal navigation, as just looking at the character where you want to be, typing f or F key and then a few ;, and you can get there more quickly than you would have by other movement commands. -- Micah J. Cowan http://micah.cowan.name/ Index: mode-key.c === --- mode-key.c.orig +++ mode-key.c @@ -88,6 +88,12 @@ struct mode_key_cmdstr mode_key_cmdstr_c { MODEKEYCOPY_GOTOLINE, goto-line }, { MODEKEYCOPY_HISTORYBOTTOM, history-bottom }, { MODEKEYCOPY_HISTORYTOP, history-top }, + { MODEKEYCOPY_JUMPTOBEFORECHARBACK, jump-to-before-char-back }, + { MODEKEYCOPY_JUMPTOBEFORECHAR, jump-to-before-char }, + { MODEKEYCOPY_JUMPTOCHARAGAIN, jump-to-char-again }, + { MODEKEYCOPY_JUMPTOCHARAGAINREVERSE, jump-to-char-again-reverse }, + { MODEKEYCOPY_JUMPTOCHARBACK, jump-to-char-back }, + { MODEKEYCOPY_JUMPTOCHAR, jump-to-char }, { MODEKEYCOPY_LEFT, cursor-left }, { MODEKEYCOPY_RECTANGLETOGGLE, rectangle-toggle }, { MODEKEYCOPY_MIDDLELINE, middle-line }, @@ -177,6 +183,8 @@ struct mode_key_tree mode_key_tree_vi_ch const struct mode_key_entry mode_key_vi_copy[] = { { ' ', 0, MODEKEYCOPY_STARTSELECTION }, { '$', 0, MODEKEYCOPY_ENDOFLINE }, + { ',', 0, MODEKEYCOPY_JUMPTOCHARAGAINREVERSE }, + { ';', 0, MODEKEYCOPY_JUMPTOCHARAGAIN }, { '/', 0, MODEKEYCOPY_SEARCHDOWN }, { '0', 0, MODEKEYCOPY_STARTOFLINE }, { '1', 0, MODEKEYCOPY_STARTNUMBERPREFIX }, @@ -192,6 +200,7 @@ const struct mode_key_entry mode_key_vi_ { '?', 0, MODEKEYCOPY_SEARCHUP }, { 'B', 0, MODEKEYCOPY_PREVIOUSSPACE }, { 'E', 0, MODEKEYCOPY_NEXTSPACEEND }, + { 'F', 0, MODEKEYCOPY_JUMPTOCHARBACK }, { 'G', 0, MODEKEYCOPY_HISTORYBOTTOM }, { 'H', 0, MODEKEYCOPY_TOPLINE }, { 'J', 0, MODEKEYCOPY_SCROLLDOWN }, @@ -199,6 +208,7 @@ const struct mode_key_entry mode_key_vi_ { 'L', 0, MODEKEYCOPY_BOTTOMLINE }, { 'M', 0, MODEKEYCOPY_MIDDLELINE }, { 'N', 0, MODEKEYCOPY_SEARCHREVERSE }, + { 'T', 0, MODEKEYCOPY_JUMPTOBEFORECHARBACK }, { 'W', 0, MODEKEYCOPY_NEXTSPACE }, { '\002' /* C-b */, 0, MODEKEYCOPY_PREVIOUSPAGE }, { '\003' /* C-c */, 0, MODEKEYCOPY_CANCEL }, @@ -213,6 +223,7 @@ const struct mode_key_entry mode_key_vi_ { '^', 0, MODEKEYCOPY_BACKTOINDENTATION }, { 'b', 0, MODEKEYCOPY_PREVIOUSWORD }, { 'e', 0, MODEKEYCOPY_NEXTWORDEND }, + { 'f', 0, MODEKEYCOPY_JUMPTOCHAR }, { 'g', 0, MODEKEYCOPY_HISTORYTOP }, { 'h', 0, MODEKEYCOPY_LEFT }, { 'j', 0, MODEKEYCOPY_DOWN }, @@ -220,6 +231,7 @@ const struct mode_key_entry mode_key_vi_ { 'l', 0, MODEKEYCOPY_RIGHT }, { 'n', 0, MODEKEYCOPY_SEARCHAGAIN }, { 'q', 0, MODEKEYCOPY_CANCEL }, + { 't', 0, MODEKEYCOPY_JUMPTOBEFORECHAR }, { 'v', 0, MODEKEYCOPY_RECTANGLETOGGLE }, { 'w', 0, MODEKEYCOPY_NEXTWORD }, { KEYC_BSPACE, 0, MODEKEYCOPY_LEFT }, @@ -290,6 +302,8 @@ struct mode_key_tree mode_key_tree_emacs /* emacs copy mode keys. */ const struct mode_key_entry mode_key_emacs_copy[] = { { ' ', 0, MODEKEYCOPY_NEXTPAGE }, + { ',', 0, MODEKEYCOPY_JUMPTOCHARAGAINREVERSE }, + { ';', 0, MODEKEYCOPY_JUMPTOCHARAGAIN }, { '1' | KEYC_ESCAPE, 0, MODEKEYCOPY_STARTNUMBERPREFIX }, { '2' | KEYC_ESCAPE, 0, MODEKEYCOPY_STARTNUMBERPREFIX }, { '3' | KEYC_ESCAPE, 0, MODEKEYCOPY_STARTNUMBERPREFIX }, @@ -301,8 +315,11 @@ const struct mode_key_entry mode_key_ema { '9' | KEYC_ESCAPE, 0, MODEKEYCOPY_STARTNUMBERPREFIX }, { '' | KEYC_ESCAPE,0, MODEKEYCOPY_HISTORYTOP }, { '' | KEYC_ESCAPE,0, MODEKEYCOPY_HISTORYBOTTOM }, + { 'F', 0, MODEKEYCOPY_JUMPTOCHARBACK }, + { 'N', 0, MODEKEYCOPY_SEARCHREVERSE }, { 'R' | KEYC_ESCAPE, 0, MODEKEYCOPY_TOPLINE }, { 'R', 0, MODEKEYCOPY_RECTANGLETOGGLE }, + { 'T', 0, MODEKEYCOPY_JUMPTOBEFORECHARBACK }, { '\000' /* C-Space */, 0, MODEKEYCOPY_STARTSELECTION }, { '\001' /* C-a */, 0, MODEKEYCOPY_STARTOFLINE }, { '\002' /* C-b */, 0, MODEKEYCOPY_LEFT }, @@ -319,12 +336,14 @@ const struct mode_key_entry mode_key_ema { '\033' /* Escape */, 0, MODEKEYCOPY_CANCEL }, { 'N', 0, MODEKEYCOPY_SEARCHREVERSE }, { 'b' |
[Patch] BUG: clipped copies on wrapped lines
If you select some text from a wrapped line, where the selection is of stuff before the final wrap of the line, the final chraracter gets stripped on copy. This patch fixes the problem for me. -- Micah J. Cowan http://micah.cowan.name/ Index: sf/window-copy.c === --- sf.orig/window-copy.c 2010-02-16 10:16:04.0 -0800 +++ sf/window-copy.c 2010-02-16 10:17:17.0 -0800 @@ -1222,7 +1222,7 @@ } /* Only add a newline if the line wasn't wrapped. */ - if (!wrapped) { + if (!wrapped || ex != xx) { *buf = xrealloc(*buf, 1, (*off) + 1); (*buf)[(*off)++] = '\n'; } -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: [Patch] numeric copy-command prefixes
Nicholas Marriott wrote: I'll look at all your diffs in detail later tonight but I can tell you now there is no way a macro like this is going in :-). Better suggestion, then? ...I could dupe the for-loop a buncha times, but the macro looks cleaner to my eyes. Or did you just mean the first, much uglier version? -- Micah J. Cowan http://micah.cowan.name/ -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[Patch] Glitch: next-word at eol
Next-word, when it wraps at the end-of-line, will never stop at the first character, even if it's a word character. This tiny patch fixes that. This patch is meant to apply after the word-separators patch, though the glitch is from before that. The word-separators patch merged the two search loops into one (since they both now needed to check for end-of-line), so a fix for the code without that patch would be at a different nesting level (but would otherwise be the same). -- Micah J. Cowan http://micah.cowan.name/ Index: window-copy.c === --- window-copy.c.orig +++ window-copy.c @@ -1451,8 +1451,8 @@ py = screen_hsize(back_s) + data-cy - data-oy; xx = window_copy_find_length(wp, py); - } - px++; + } else +px++; } expected = !expected; } while (expected == 1); @@ -1490,8 +1490,8 @@ py = screen_hsize(back_s) + data-cy - data-oy; xx = window_copy_find_length(wp, py); - } - px++; + } else +px++; } expected = !expected; } while (expected == 0); -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[Patch] user-specifiable word-separators
This patch allows the user to specify what characters are considered word separators for the purposes of the next and previous word commands in copy mode (bound to M-b and M-f in emacs-copy; w, b and e in vi-copy). Since the space character is no longer guaranteed to be one of the word separator characters, the next and previous word functions had to be adjusted so that both of the loops explicitly check whether they're past the line (this may have been necessary anyway? I experienced an apparently related crash once, but couldn't reproduce it). This makes the two loops in each function identical, apart from whether they are or aren't looking for word-separators, so I merged them into one loop, with an outer loop that runs them twice (once looking for one kind of character, once looking for the other). The man page said that the quote character '' is among those used by previous and next word, but it has not been, so I removed that from the list in the manpage. While testing, I noticed that the semicolon character in the string argument to set-w word-separators is ignored if it appears at the end of the (quoted) string... the message bar tells me that it set it to the string sans semicolon. Will investigate, but not related to my patch. -- Micah J. Cowan http://micah.cowan.name/ Index: tmux.c === --- tmux.c.orig +++ tmux.c @@ -421,6 +421,7 @@ options_set_number(wo, window-status-fg, 8); options_set_string(wo, window-status-format, #I:#W#F); options_set_string(wo, window-status-current-format, #I:#W#F); + options_set_string(wo, word-separators, -_@); options_set_number(wo, xterm-keys, 0); options_set_number(wo, remain-on-exit, 0); options_set_number(wo, synchronize-panes, 0); Index: window-copy.c === --- window-copy.c.orig +++ window-copy.c @@ -320,7 +320,7 @@ void window_copy_key(struct window_pane *wp, struct client *c, int key) { - const char *word_separators = -_@; + const char *word_separators; struct window_copy_mode_data *data = wp-modedata; struct screen *s = data-screen; u_int n; @@ -450,15 +450,21 @@ window_copy_cursor_next_word_end(wp, ); break; case MODEKEYCOPY_NEXTWORD: + word_separators = + options_get_string(wp-window-options, word-separators); window_copy_cursor_next_word(wp, word_separators); break; case MODEKEYCOPY_NEXTWORDEND: + word_separators = + options_get_string(wp-window-options, word-separators); window_copy_cursor_next_word_end(wp, word_separators); break; case MODEKEYCOPY_PREVIOUSSPACE: window_copy_cursor_previous_word(wp, ); break; case MODEKEYCOPY_PREVIOUSWORD: + word_separators = + options_get_string(wp-window-options, word-separators); window_copy_cursor_previous_word(wp, word_separators); break; case MODEKEYCOPY_SEARCHUP: @@ -1347,30 +1353,33 @@ struct window_copy_mode_data *data = wp-modedata; struct screen *back_s = data-backing; u_int px, py, xx, yy; + int expected = 0; px = data-cx; py = screen_hsize(back_s) + data-cy - data-oy; xx = window_copy_find_length(wp, py); yy = screen_hsize(back_s) + screen_size_y(back_s) - 1; - /* Are we in a word? Skip it! */ - while (!window_copy_in_set(wp, px, py, separators)) - px++; - - /* Find the start of a word. */ - while (px xx || window_copy_in_set(wp, px, py, separators)) { - /* Past the end of the line? Nothing but spaces. */ - if (px xx) { - if (py == yy) -return; - window_copy_cursor_down(wp, 0); - px = 0; + /* First skip past any word chars, then skip past any non-word + * chars. */ + do { + while (px xx + || (window_copy_in_set(wp, px, py, separators) + == expected)) { + /* Move down if we're past the end of the line. */ + if (px xx) { +if (py == yy) + return; +window_copy_cursor_down(wp, 0); +px = 0; - py = screen_hsize(back_s) + data-cy - data-oy; - xx = window_copy_find_length(wp, py); +py = screen_hsize(back_s) + data-cy - data-oy; +xx = window_copy_find_length(wp, py); + } + px++; } - px++; - } + expected = !expected; + } while (expected == 1); window_copy_update_cursor(wp, px, data-cy); if (window_copy_update_selection(wp)) @@ -1383,30 +1392,33 @@ struct window_copy_mode_data *data = wp-modedata; struct screen *back_s = data-backing; u_int px, py, xx, yy; + int expected = 1; px = data-cx; py = screen_hsize(back_s) + data-cy - data-oy; xx = window_copy_find_length(wp, py); yy = screen_hsize(back_s) + screen_size_y(back_s) - 1; - /* Are we on spaces? Skip 'em! */ - while (px xx || window_copy_in_set(wp, px, py, separators)) { - /* Nothing but spaces past the end of the line, so move down. */ - if (px xx) { - if (py == yy) -return; - window_copy_cursor_down(wp, 0); - px = 0; + /* First skip past any non-word chars, then skip past any word + * chars. */
Re: [Patch] Replace output mode with copy mode
Micah Cowan wrote: + screen_write_start(ctx, wp, data-screen); + ox = data-screen.cx; + oy = data-screen.cy; + + /* If the history has changed, draw the top line. + * (If there's any history at all, it has changed.) */ + if (screen_hsize(data-backing)) + window_copy_write_line(wp, ctx, 0); + + /* Write the line, if it's visible. */ + if (backing-cy + data-oy screen_size_y(backing)) + window_copy_write_line(wp, ctx, backing-cy); + + data-screen.cx = data-cx = ox; + data-screen.cy = data-cy = oy; + screen_write_stop(ctx); Or perhaps this funny stuff with ox, oy isn't necessary if I use redraw_lines instead of write_line. -- Micah J. Cowan http://micah.cowan.name/ -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: [Patch] Replace output mode with copy mode
Here's a diff for the manpage to go with the diff for the code. I've also included a convenience diff against the processed manpages, mans.diff, for an easier view of what I've changed. -- Micah J. Cowan http://micah.cowan.name/ --- /tmp/old 2010-02-13 21:00:37.921671553 -0800 +++ /tmp/new 2010-02-13 21:00:32.893671411 -0800 @@ -288,17 +288,12 @@ WINDOWS AND PANES A tmux window may be in one of several modes. The default permits direct - access to the terminal attached to the window. The others are: - - output mode - This is entered when a command which produces output, such as - list-keys, is executed from a key binding. - - copy mode - This permits a section of a window or its history to be copied to - a paste buffer for later insertion into another window. This - mode is entered with the copy-mode command, bound to â[â by - default. + access to the terminal attached to the window. The other is copy mode, + which permits a section of a window or its history to be copied to a + paste buffer for later insertion into another window. This mode is + entered with the copy-mode command, bound to â[â by default. It is also + entered when a command that produces output, such as list-keys, is exeâ + cuted from a key binding. The keys available depend on whether emacs or vi mode is selected (see the mode-keys option). The following keys are supported as appropriate @@ -353,15 +348,14 @@ These key bindings are defined in a set of named tables: vi-edit and emacs-edit for keys used when line editing at the command prompt; vi-choice and emacs-choice for keys used when choosing from lists (such - as produced by the choose-window command) or in output mode; and vi-copy - and emacs-copy used in copy mode. The tables may be viewed with the - list-keys command and keys modified or removed with bind-key and - unbind-key. + as produced by the choose-window command); and vi-copy and emacs-copy + used in copy mode. The tables may be viewed with the list-keys command + and keys modified or removed with bind-key and unbind-key. The paste buffer key pastes the first line from the top paste buffer on the stack. - The mode commands are as follows: + The synopsis for the copy-mode command is: copy-mode [-u] [-t target-pane] Enter copy mode. The -u option scrolls one page up. @@ -1106,8 +1100,8 @@ synchronize-panes [on | off] Duplicate input to any pane to all other panes in the - same window, except for panes that are not in output - mode. + same window (only for panes that are not in any special + mode). alternate-screen [on | off] This option configures whether programs running inside @@ -1341,8 +1335,8 @@ (alias: run) Execute command in the background without creating a window. After the command finishes, any output to stdout is displayed in - output mode. If command doesn't return success, the exit status - is also displayed. + copy mode. If command doesn't return success, the exit status is + also displayed. server-info (alias: info) Index: tmux.1 === --- tmux.1.orig +++ tmux.1 @@ -517,22 +517,18 @@ .Nm window may be in one of several modes. The default permits direct access to the terminal attached to the window. -The others are: -.Bl -tag -width Ds -.It Em output mode -This is entered when a command which produces output, such as -.Ic list-keys , -is executed from a key binding. -.It Em copy mode -This permits a section of a window or its history to be copied to a +The other is copy mode, which permits a section of a window or its +history to be copied to a .Em paste buffer for later insertion into another window. This mode is entered with the .Ic copy-mode command, bound to .Ql \[ -by default. -.El +by default. It is also entered when a command that produces output, +such as +.Ic list-keys , +is executed from a key binding. .Pp The keys available depend on whether emacs or vi mode is selected (see the @@ -603,7 +599,7 @@ .Em emacs-choice for keys used when choosing from lists (such as produced by the .Ic choose-window -command) or in output mode; and +command); and .Em vi-copy and .Em emacs-copy @@ -618,7 +614,9 @@ The paste buffer key pastes the first line from the top paste buffer on the stack. .Pp -The mode commands are as follows: +The synopsis for the +.Ic copy-mode +command is: .Bl -tag -width Ds .It Xo Ic copy-mode .Op Fl u @@ -1896,8 +1894,8 @@ .It Xo Ic synchronize-panes .Op Ic on | off .Xc -Duplicate input to
Re: [Patch] Repeat search in reverse direction
New version of the patch. Nicholas Marriott wrote: Hi Thanks for the diff, n retains the sense of the last search (repeats in the same direction), so this is to reverse the sense of the last search? +if ((data-searchtype == WINDOW_COPY_SEARCHUP) +== (cmd == MODEKEYCOPY_SEARCHAGAIN)) This should be , I expect. I think I would rather have a separate if in each case, eg: case WINDOW_COPY_SEARCHUP: if (cmd == MODEKEYCOPY_SEARCHAGAIN) window_copy_search_up(wp, data-searchstr); else window_copy_search_down(wp, data-searchstr); break; And similar for WINDOW_COPY_SEARCHDOWN. -- Micah J. Cowan http://micah.cowan.name/ Index: mode-key.c === --- mode-key.c.orig +++ mode-key.c @@ -104,6 +104,7 @@ { MODEKEYCOPY_SCROLLUP, scroll-up }, { MODEKEYCOPY_SEARCHAGAIN, search-again }, { MODEKEYCOPY_SEARCHDOWN, search-forward }, + { MODEKEYCOPY_SEARCHREVERSE, search-reverse }, { MODEKEYCOPY_SEARCHUP, search-backward }, { MODEKEYCOPY_STARTOFLINE, start-of-line }, { MODEKEYCOPY_STARTSELECTION, begin-selection }, @@ -187,6 +188,7 @@ { 'K', 0, MODEKEYCOPY_SCROLLUP }, { 'L', 0, MODEKEYCOPY_BOTTOMLINE }, { 'M', 0, MODEKEYCOPY_MIDDLELINE }, + { 'N', 0, MODEKEYCOPY_SEARCHREVERSE }, { 'W', 0, MODEKEYCOPY_NEXTSPACE }, { '\002' /* C-b */, 0, MODEKEYCOPY_PREVIOUSPAGE }, { '\003' /* C-c */, 0, MODEKEYCOPY_CANCEL }, @@ -296,6 +298,7 @@ { '\026' /* C-v */, 0, MODEKEYCOPY_NEXTPAGE }, { '\027' /* C-w */, 0, MODEKEYCOPY_COPYSELECTION }, { '\033' /* Escape */, 0, MODEKEYCOPY_CANCEL }, + { 'N', 0, MODEKEYCOPY_SEARCHREVERSE }, { 'b' | KEYC_ESCAPE, 0, MODEKEYCOPY_PREVIOUSWORD }, { 'f' | KEYC_ESCAPE, 0, MODEKEYCOPY_NEXTWORDEND }, { 'g', 0, MODEKEYCOPY_GOTOLINE }, Index: tmux.h === --- tmux.h.orig +++ tmux.h @@ -474,6 +474,7 @@ MODEKEYCOPY_SCROLLUP, MODEKEYCOPY_SEARCHAGAIN, MODEKEYCOPY_SEARCHDOWN, + MODEKEYCOPY_SEARCHREVERSE, MODEKEYCOPY_SEARCHUP, MODEKEYCOPY_STARTOFLINE, MODEKEYCOPY_STARTSELECTION, Index: window-copy.c === --- window-copy.c.orig +++ window-copy.c @@ -224,6 +224,7 @@ struct screen *s = data-screen; u_int n; int keys; + enum mode_key_cmd cmd; if (data-inputtype != WINDOW_COPY_OFF) { if (window_copy_key_input(wp, key) != 0) @@ -231,7 +232,8 @@ return; } - switch (mode_key_lookup(data-mdata, key)) { + cmd = mode_key_lookup(data-mdata, key); + switch (cmd) { case MODEKEYCOPY_CANCEL: window_pane_reset_mode(wp); break; @@ -367,15 +369,22 @@ data-inputprompt = Search Down; goto input_on; case MODEKEYCOPY_SEARCHAGAIN: + case MODEKEYCOPY_SEARCHREVERSE: switch (data-searchtype) { case WINDOW_COPY_OFF: case WINDOW_COPY_GOTOLINE: break; case WINDOW_COPY_SEARCHUP: - window_copy_search_up(wp, data-searchstr); + if (cmd == MODEKEYCOPY_SEARCHAGAIN) +window_copy_search_up(wp, data-searchstr); + else +window_copy_search_down(wp, data-searchstr); break; case WINDOW_COPY_SEARCHDOWN: - window_copy_search_down(wp, data-searchstr); + if (cmd == MODEKEYCOPY_SEARCHAGAIN) +window_copy_search_down(wp, data-searchstr); + else +window_copy_search_up(wp, data-searchstr); break; } break; Index: tmux.1 === --- tmux.1.orig +++ tmux.1 @@ -572,6 +572,7 @@ .It Li Scroll down Ta C-Down or C-e Ta C-Down .It Li Scroll up Ta C-Up or C-y Ta C-Up .It Li Search again Ta n Ta n +.It Li Search again in reverse Ta N Ta N .It Li Search backward Ta ? Ta C-r .It Li Search forward Ta / Ta C-s .It Li Start of line Ta 0 Ta C-a -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: [Patch] Repeat search in reverse direction
Nicholas Marriott wrote: Hi Thanks for the diff, n retains the sense of the last search (repeats in the same direction), so this is to reverse the sense of the last search? Well, it's to search in the reverse of the last actually typed search. So, if you searched up, n will continue searching up. N will search down, but it doesn't reverse the sense in a permanent way; it just searches the opposite of the current sense. So continued Ns keep searching the same direction, and an n will go back to the original sense. +if ((data-searchtype == WINDOW_COPY_SEARCHUP) +== (cmd == MODEKEYCOPY_SEARCHAGAIN)) This should be , I expect. Well, no, because if it were , then it would search down when the original sense was down, regardless of whether the cmd is MODEKEYCOPY_SEARCHAGAIN or MODEKEYCOPY_SEARCHREVERSE. If both inner clauses are false (we're not searching up but the command's not SEARCHAGAIN), I want the net result to be true (search up). I think I would rather have a separate if in each case, eg: case WINDOW_COPY_SEARCHUP: if (cmd == MODEKEYCOPY_SEARCHAGAIN) window_copy_search_up(wp, data-searchstr); else window_copy_search_down(wp, data-searchstr); break; And similar for WINDOW_COPY_SEARCHDOWN. Fair enough. I imagine you don't need me to reroll the patch for that, right? -- Micah J. Cowan http://micah.cowan.name/ -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: terminal-overrides: proper terminfo entries?
Nicholas Marriott wrote: - Any time I view a manual page, use the less pager or the vim editor, I get a fresh screen page. This disturbs me somewhat, because I'm used to go up in copy-mode, select some text and paste it where it's needed. I don't understand what you mean by this. I think he's referring to the alternate buffer. clemens, one way of working around that would be to simply suspend less or vim (or whatever) with C-z, enter copy-mode and grab what you want, then exit copy-mode and resume your app. -- Micah J. Cowan http://micah.cowan.name/ -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: terminal-overrides: proper terminfo entries?
clemens fischer wrote: Micah Cowan wrote: I think he's referring to the alternate buffer. clemens, one way of working around that would be to simply suspend less or vim (or whatever) with C-z, enter copy-mode and grab what you want, then exit copy-mode and resume your app. Oh, I'm doing that all the time, but no dice. Suspend vim and poof, I get to see whatever was on screen before that, but nothing from the screen session. Then I'm not understanding what you're asking for. -- Micah J. Cowan http://micah.cowan.name/ -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: terminal-overrides: proper terminfo entries?
clemens fischer wrote: The problem I see looking at lines 1189pp @ input.c is the GRID_HISTORY flag, which is supposed to be off after handling the sm sequence. I'm not sure if it should stay on if a new option disables the saved_grid. My guess would be that this flag controls whether or not there's scrollback saved for the currently-displayed screen (grid). So you want it on so long as you're not in alternate-screen (smcup) mode. So yeah, it should probably stay on. -- Micah J. Cowan http://micah.cowan.name/ -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: [Patch] Don't complain about nested tmux if it's a new server.
Micah Cowan wrote: Micah Cowan wrote: Nicholas Marriott wrote: Hi This is a cool idea, tmux should definitely just do the right thing. We could call realpath() to get around the // issue. If we did it on path in main.c and that would clean up TMUX as well. Alright. I'm thinking it may be worthwhile to parse TMUX properly, once, and avoid all these various partial parses we're now doing. I'll submit a patch for that first, and submit the revision for this patch to be applied after that one. Attached is the patch for parsing TMUX in one place. Ugh, that patch is broken, as it tests for the results of fill_session before it's called. Here's a fixed version, tmux-parse.1.diff, and a revised nested.1.diff, which is meant to apply atop tmux-parse.1.diff. -mjc Index: sf/server-client.c === --- sf.orig/server-client.c 2010-02-05 08:36:25.0 -0800 +++ sf/server-client.c 2010-02-05 08:37:43.0 -0800 @@ -692,17 +692,6 @@ } cmd_free_argv(argc, argv); - if (data-pid != -1) { - TAILQ_FOREACH(cmd, cmdlist, qentry) { - if (cmd-entry-flags CMD_CANTNEST) { -server_client_msg_error(ctx, -sessions should be nested with care. -unset $TMUX to force); -goto error; - } - } - } - if (cmd_list_exec(cmdlist, ctx) != 1) server_write_client(c, MSG_EXIT, NULL, 0); cmd_list_free(cmdlist); Index: sf/tmux.c === --- sf.orig/tmux.c 2010-02-05 08:37:05.0 -0800 +++ sf/tmux.c 2010-02-05 08:42:07.0 -0800 @@ -491,6 +491,7 @@ cmddata.pid = envdata.pid; cmddata.idx = envdata.idx; + /* Prepare command for server. */ cmddata.argc = argc; if (cmd_pack_argv( argc, argv, cmddata.argv, sizeof cmddata.argv) != 0) { @@ -506,7 +507,7 @@ if (shellcmd != NULL) cmdflags |= CMD_STARTSERVER; else if (argc == 0) /* new-session is the default */ - cmdflags |= CMD_STARTSERVER|CMD_SENDENVIRON; + cmdflags |= CMD_STARTSERVER|CMD_SENDENVIRON|CMD_CANTNEST; else { /* * It sucks parsing the command string twice (in client and @@ -523,10 +524,22 @@ cmdflags |= CMD_STARTSERVER; if (cmd-entry-flags CMD_SENDENVIRON) cmdflags |= CMD_SENDENVIRON; + if (cmd-entry-flags CMD_CANTNEST) +cmdflags |= CMD_CANTNEST; } cmd_list_free(cmdlist); } + /* Heuristic check for nested tmux sessions on same server. */ + if (shellcmd == NULL + envdata.path != NULL + (cmdflags CMD_CANTNEST) + ((path == envdata.path) || strcmp(path, envdata.path) == 0)) { + log_warnx(sessions should be nested with care. + unset $TMUX to force.); + exit(1); + } + if ((main_ibuf = client_init(path, cmdflags, flags)) == NULL) exit(1); xfree(path); Index: sf/tmux.c === --- sf.orig/tmux.c 2010-02-04 19:06:51.0 -0800 +++ sf/tmux.c 2010-02-05 08:37:05.0 -0800 @@ -30,6 +30,12 @@ #include tmux.h +struct env_session_data { + char *path; + pid_t pid; + u_int idx; +}; + #if defined(DEBUG) defined(__OpenBSD__) extern char *malloc_options; #endif @@ -46,7 +52,7 @@ int login_shell; __dead void usage(void); -void fill_session(struct msg_command_data *); +void fill_session(struct env_session_data *); char *makesockpath(const char *); __dead void shell_exec(const char *, const char *); @@ -132,9 +138,9 @@ } void -fill_session(struct msg_command_data *data) +fill_session(struct env_session_data *data) { - char *env, *ptr1, *ptr2, buf[256]; + char *env, *path_pid, *pid_idx, buf[256]; size_t len; const char *errstr; long long ll; @@ -143,19 +149,24 @@ if ((env = getenv(TMUX)) == NULL) return; - if ((ptr2 = strrchr(env, ',')) == NULL || ptr2 == env) + if ((path_pid = strchr(env, ',')) == NULL || path_pid == env) + return; + if ((pid_idx = strchr(path_pid+1, ',')) == NULL) return; - for (ptr1 = ptr2 - 1; ptr1 env *ptr1 != ','; ptr1--) - ; - if (*ptr1 != ',') + if ((pid_idx == path_pid+1 || pid_idx[1] == '\0')) return; - ptr1++; - ptr2++; - len = ptr2 - ptr1 - 1; + /* path */ + len = path_pid - env; + data-path = xmalloc (len + 1); + memcpy(data-path, env, len); + data-path[len] = '\0'; + + /* pid */ + len = pid_idx - path_pid - 1; if (len (sizeof buf) - 1) return; - memcpy(buf, ptr1, len); + memcpy(buf, path_pid+1, len); buf[len] = '\0'; ll = strtonum(buf, 0, LONG_MAX, errstr); @@ -163,7 +174,8 @@ return; data-pid = ll; - ll = strtonum(ptr2, 0, UINT_MAX, errstr); + /* idx */ + ll = strtonum(pid_idx+1, 0, UINT_MAX, errstr); if (errstr != NULL) return; data-idx = ll; @@ -227,6 +239,7 @@ struct passwd *pw; struct options *oo, *so, *wo; struct keylist *keylist; + struct env_session_data envdata; struct msg_command_data cmddata; char *s, *shellcmd, *path, *label, *home, *cause; char cwd[MAXPATHLEN], **var; @@ -241,6 +254,7
(For real this time) Re: Strange output-pause bug in tmux
G... One word: compiz. Didn't even realize I had it on this machine (IT provided the image). The windows weren't doing cool desktop-effect things, so I didn't even think about it. When I discovered it, I disabled it, and bam! It works as expected now. Yeesh. -- Micah J. Cowan http://micah.cowan.name/ -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: [Patch] status-drawing crash
Nicholas Marriott wrote: Bad memory accesses occurs when we get to the call to grid_compare() after the out: label. Inside grid_compare(), the inner loop assumes that both grids use their entire horizontal space on each line. Hmm. It explicitly checks they are the same size (gla-cellsize != glb-cellsize), why doesn't that catch it? IIRC, at that point, they are both cellsize == 1. The inner loop doesn't use cellsize as the limit, it uses ga-sx, under the assumption that cellsize for both == ga-sx. Which is normally true, when we haven't wrapped like that. -- Micah J. Cowan http://micah.cowan.name/ -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Bug and fix: Graphic glitch on scroll-up when cursor on last line
Nicholas Marriott wrote: Ugh, another copy mode bug. Thanks for your diff. We need to redraw two lines because if the $ is at the end of the line it will have been scrolled. I think it is enough just to change window_copy_write_line, although I'll move the check up a bit I think. It is, of course, but the advantage to changing it in window_copy_redraw_lines() as well, is if ny is, say, 10, and we're at the second-to-last line, then it won't make a series of useless calls to window_copy_write_line()... though maybe window_copy_redraw_lines() is never called with so many, without knowing what the proper number should be. -mjc -- Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[Patch] Using C-y/C-e for scroll-up/down in vi-mode
Since October, Ctrl-Up and Ctrl-Down allows the user to scroll up and down by single lines. The vi-copy mode provides an additional set of bindings for this, to K and J. Vi has had this feature bound to C-y and C-e for ages, so I've written a patch to use these instead. Well, instead as far as the manpage is concerned, but in reality K and J are still bound in the code, per Nicholas's recommendation on IRC. -- Micah J. Cowan http://micah.cowan.name/ Index: mode-key.c === --- mode-key.c.orig +++ mode-key.c @@ -172,9 +172,11 @@ { '\002' /* C-b */, 0, MODEKEYCOPY_PREVIOUSPAGE }, { '\003' /* C-c */, 0, MODEKEYCOPY_CANCEL }, { '\004' /* C-d */, 0, MODEKEYCOPY_HALFPAGEDOWN }, + { '\005' /* C-e */, 0, MODEKEYCOPY_SCROLLDOWN }, { '\006' /* C-f */, 0, MODEKEYCOPY_NEXTPAGE }, { '\010' /* C-h */, 0, MODEKEYCOPY_LEFT }, { '\025' /* C-u */, 0, MODEKEYCOPY_HALFPAGEUP }, + { '\031' /* C-y */, 0, MODEKEYCOPY_SCROLLUP }, { '\033' /* Escape */, 0, MODEKEYCOPY_CLEARSELECTION }, { '\r', 0, MODEKEYCOPY_COPYSELECTION }, { '^', 0, MODEKEYCOPY_BACKTOINDENTATION }, Index: tmux.1 === --- tmux.1.orig +++ tmux.1 @@ -535,7 +535,7 @@ .Ic mode-keys option). The following keys are supported as appropriate for the mode: -.Bl -column Function viX emacs -offset indent +.Bl -column Function viXX emacs -offset indent .It Sy Function Ta Sy vi Ta Sy emacs .It Li Back to indentation Ta ^ Ta M-m .It Li Clear selection Ta Escape Ta C-g @@ -559,8 +559,8 @@ .It Li Previous page Ta C-b Ta Page up .It Li Previous word Ta b Ta M-b .It Li Quit mode Ta q Ta Escape -.It Li Scroll down Ta C-Down or J Ta C-Down -.It Li Scroll up Ta C-Up or K Ta C-Up +.It Li Scroll down Ta C-Down or C-e Ta C-Down +.It Li Scroll up Ta C-Up or C-y Ta C-Up .It Li Search again Ta n Ta n .It Li Search backward Ta ? Ta C-r .It Li Search forward Ta / Ta C-s -- Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: [Patch] Using C-y/C-e for scroll-up/down in vi-mode
Micah Cowan wrote: Since October, Ctrl-Up and Ctrl-Down allows the user to scroll up and down by single lines. The vi-copy mode provides an additional set of bindings for this, to K and J. Vi has had this feature bound to C-y and C-e for ages, so I've written a patch to use these instead. Well, instead as far as the manpage is concerned, but in reality K and J are still bound in the code, per Nicholas's recommendation on IRC. Someone on IRC pointed out that J and K are commonly used by vi-ish pagers, such as less and w3m. And apparently w3m doesn't support the C-y/C-e bindings. Perhaps it's worth keeping K and J as official versions as well, and keep them documented? If that's the case, here's an alternate version that keeps them documented as well. -- Micah J. Cowan http://micah.cowan.name/ Index: mode-key.c === --- mode-key.c.orig +++ mode-key.c @@ -172,9 +172,11 @@ { '\002' /* C-b */, 0, MODEKEYCOPY_PREVIOUSPAGE }, { '\003' /* C-c */, 0, MODEKEYCOPY_CANCEL }, { '\004' /* C-d */, 0, MODEKEYCOPY_HALFPAGEDOWN }, + { '\005' /* C-e */, 0, MODEKEYCOPY_SCROLLDOWN }, { '\006' /* C-f */, 0, MODEKEYCOPY_NEXTPAGE }, { '\010' /* C-h */, 0, MODEKEYCOPY_LEFT }, { '\025' /* C-u */, 0, MODEKEYCOPY_HALFPAGEUP }, + { '\031' /* C-y */, 0, MODEKEYCOPY_SCROLLUP }, { '\033' /* Escape */, 0, MODEKEYCOPY_CLEARSELECTION }, { '\r', 0, MODEKEYCOPY_COPYSELECTION }, { '^', 0, MODEKEYCOPY_BACKTOINDENTATION }, Index: tmux.1 === --- tmux.1.orig +++ tmux.1 @@ -535,7 +535,7 @@ .Ic mode-keys option). The following keys are supported as appropriate for the mode: -.Bl -column Function viX emacs -offset indent +.Bl -column Function viX emacs -offset indent .It Sy Function Ta Sy vi Ta Sy emacs .It Li Back to indentation Ta ^ Ta M-m .It Li Clear selection Ta Escape Ta C-g @@ -559,8 +559,8 @@ .It Li Previous page Ta C-b Ta Page up .It Li Previous word Ta b Ta M-b .It Li Quit mode Ta q Ta Escape -.It Li Scroll down Ta C-Down or J Ta C-Down -.It Li Scroll up Ta C-Up or K Ta C-Up +.It Li Scroll down Ta C-Down, J or C-e Ta C-Down +.It Li Scroll up Ta C-Up, K or C-y Ta C-Up .It Li Search again Ta n Ta n .It Li Search backward Ta ? Ta C-r .It Li Search forward Ta / Ta C-s -- Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users