Regarding the window-tmux redraw issue
Hi, I faced a issue of tmux not recognising the window dimensions correctly in xterm. Nicholas suggested in #tmux to add client_write_server(MSG_RESIZE, NULL, 0); in client.c(CVS head) .. That seemed to have solved the dimensions problem. But the window still does not get redrawn. Only doing prefix-r or running any other command like ls overwrites it. I have tested this with xmonad and dwm. In both this issue persists. I am attaching tmux info for reference. --- Raghavendra D Prabhu tmux 1.3, pid 19021, started Thu Jun 3 01:56:05 2010 socket path /tmp//tmux-1000/default, debug level 0 system is Linux 2.6.34-rc6-zen1-EIL #7 ZEN SMP PREEMPT Fri May 14 20:04:42 IST 2010 x86_64 configuration file is /home/raghavendra/.tmux.conf protocol version is 5 3 clients, 2 sessions Clients: 0: /dev/pts/0 (9, 10): term [141x43 xterm-color] [flags=0x1/0x38, references=0] 1: /dev/pts/2 (12, 13): uake [125x21 xterm-color] [flags=0x1/0x38, references=0] Sessions: [5/10] 0: term: 2 windows (created Thu Jun 3 02:05:00 2010) [141x42] [flags=0x0, references=0] 1: bash [141x42] [flags=0x0, references=1, last layout=-1] 0: /dev/pts/1 20527 11 36/42, 12020 bytes; UTF-8 0/42, 0 bytes 2: mutt [141x42] [flags=0x0, references=1, last layout=-1] 0: /dev/pts/9 21582 20 42/42, 16635 bytes; UTF-8 0/42, 0 bytes 1: uake: 6 windows (created Thu Jun 3 01:56:05 2010) [125x20] [flags=0x0, references=0] 1: weechat-curses [125x20] [flags=0x0, references=1, last layout=-1] 0: /dev/pts/3 19031 14 20/20, 10665 bytes; UTF-8 1/20, 550 bytes 2: bash [125x20] [flags=0x0, references=1, last layout=-1] 0: /dev/pts/4 19033 15 40/40, 13290 bytes; UTF-8 0/40, 0 bytes 3: less [125x20] [flags=0x0, references=1, last layout=-1] 0: /dev/pts/5 19036 16 192/199, 28850 bytes; UTF-8 0/199, 0 bytes 4: bash [125x20] [flags=0x0, references=1, last layout=-1] 0: /dev/pts/6 19041 17 1/20, 55 bytes; UTF-8 0/20, 0 bytes 5: bash [125x20] [flags=0x0, references=1, last layout=-1] 0: /dev/pts/7 19048 18 1/20, 55 bytes; UTF-8 0/20, 0 bytes 6: bash [125x20] [flags=0x0, references=1, last layout=-1] 0: /dev/pts/8 19054 19 36/54, 12230 bytes; UTF-8 0/54, 0 bytes Terminals: xterm-color [references=2, flags=0x0]: 1: acsc: (string) ``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~ 0: AX: [missing] 2: bel: (string) \007 3: blink: [missing] 4: bold: (string) \033[1m 5: civis: [missing] 6: clear: (string) \033[H\033[2J 7: cnorm: [missing] 8: colors: (number) 8 9: csr: (string) \033[%i%p1%d;%p2%dr 10: cub: (string) \033[%p1%dD 11: cub1: (string) \010 12: cud: (string) \033[%p1%dB 13: cud1: (string) \012 14: cuf: (string) \033[%p1%dC 15: cuf1: (string) \033[C 16: cup: (string) \033[%i%p1%d;%p2%dH 17: cuu: (string) \033[%p1%dA 18: cuu1: (string) \033[A 19: dch: (string) \033[%p1%dP 20: dch1: (string) \033[P 21: dim: [missing] 22: dl: (string) \033[%p1%dM 23: dl1: (string) \033[M 24: el: (string) \033[K 25: el1: [missing] 26: enacs: (string) \033)0 27: home: (string) \033[H 28: hpa: [missing] 29: ich: [missing] 30: ich1: [missing] 31: il: (string) \033[%p1%dL 32: il1: (string) \033[L 33: invis: [missing] 34: is1: [missing] 35: is2: (string) \033[m\033[?7h\033[4l\033>\0337\033[r\033[?1;3;4;6l\0338 36: is3: [missing] 37: kcbt: [missing] 38: kcub1: (string) \033OD 39: kcud1: (string) \033OB 40: kcuf1: (string) \033OC 41: kcuu1: (string) \033OA 42: kDC: [missing] 43: kDC3: [missing] 44: kDC4: [missing] 45: kDC5: [missing] 46: kDC6: [missing] 47: kDC7: [missing] 48: kdch1: (string) \033[3~ 49: kDN: [missing] 50: kDN3: [missing] 51: kDN4: [missing] 52: kDN5: [missing] 53: kDN6: [missing] 54: kDN7: [missing] 55: kend: [missing] 56: kEND: [missing] 57: kEND3: [missing] 58: kEND4: [missing] 59: kEND5: [missing] 60: kEND6: [missing] 61: kEND7: [missing] 62: kf1: (string) \033[11~ 63: kf10: (string) \033[21~ 64: kf11: (string) \033[23~ 65: kf12: (string) \033[24~ 66: kf13: (string) \033[25~ 67: kf14: (string) \033[26~ 68: kf15: (string) \033[28~ 69: kf16: (string) \033[29~ 70: kf17: (string) \033[31~ 71: kf18: (string) \033[32~ 72: kf19: (string) \033[33~ 73: kf2: (string) \033[12~ 74: kf20: (string) \033[34~ 75: kf3: (string) \033[13~ 76: kf4: (string) \033[14~ 77: kf5: (string) \033[15~ 78: kf6: (string) \033[17~ 79: kf7: (string) \033[18~ 80: kf8: (string) \033[19~ 81: kf9: (string) \033[20~ 82: kHOM: [missing] 83: kHOM3: [missing] 84: kHOM4: [missing] 85: kHOM5: [missing] 86: kHOM6: [missing] 87: kHOM7: [missing] 88: khome: [missing] 89: kIC: [missing] 90: kIC3: [missing] 91: kIC4: [missing] 92: kIC5: [missing] 93: kIC6: [missing] 94: kIC7: [missing] 95: kich1: (string) \033[2~ 96: kLFT: [missing] 97: kLFT3: [missing] 98: kLFT4: [missing] 99: kLFT5: [missing] 100: kLFT6: [missing] 101: kLFT7: [missing] 102: kmous: (string) \033[M 103: knp: (string) \033[6~ 104: kNXT: [missing] 105: kNXT3: [missing] 106: kNXT4: [missing] 107: kNXT5: [missing] 108: kNXT6: [missing] 109: kNXT7: [miss
Re: Regarding the window-tmux redraw issue
if (tty->flags & TTY_STARTED) { >+ tty_cursor(tty, 0, 0); >+ tty_region(tty, 0, tty->sy - 1); >+ } >+ >+ return (1); > } > > int > tty_open(struct tty *tty, const char *overrides, char **cause) > { >+ char out[MAXPATHLEN]; > int fd; > > if (debug_level > 3) { >- fd = open("tmux.out", O_WRONLY|O_CREAT|O_TRUNC, 0644); >+ xsnprintf(out, sizeof out, "tmux-out-%ld.log", (long) getpid()); >+ fd = open(out, O_WRONLY|O_CREAT|O_TRUNC, 0644); > if (fd != -1 && fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) > fatal("fcntl failed"); > tty->log_fd = fd; > > > > > >On Thu, Jun 03, 2010 at 02:29:22AM +0530, Raghavendra D Prabhu wrote: >> Hi, >> I faced a issue of tmux not recognising the window dimensions correctly in >> xterm. >> Nicholas suggested in #tmux to add >> >> client_write_server(MSG_RESIZE, NULL, 0); >> >> in client.c(CVS head) .. That seemed to have solved the dimensions >> problem. But the window still does not get redrawn. Only doing >> prefix-r or running any >> other command like ls overwrites it. >> >> I have tested this with xmonad and dwm. In both this issue persists. I am >> attaching tmux info for reference. >> >> >> --- >> Raghavendra D Prabhu > >> tmux 1.3, pid 19021, started Thu Jun 3 01:56:05 2010 >> socket path /tmp//tmux-1000/default, debug level 0 >> system is Linux 2.6.34-rc6-zen1-EIL #7 ZEN SMP PREEMPT Fri May 14 20:04:42 >> IST 2010 x86_64 >> configuration file is /home/raghavendra/.tmux.conf >> protocol version is 5 >> 3 clients, 2 sessions >> >> Clients: >> 0: /dev/pts/0 (9, 10): term [141x43 xterm-color] [flags=0x1/0x38, >> references=0] >> 1: /dev/pts/2 (12, 13): uake [125x21 xterm-color] [flags=0x1/0x38, >> references=0] >> >> Sessions: [5/10] >> 0: term: 2 windows (created Thu Jun 3 02:05:00 2010) [141x42] [flags=0x0, >> references=0] >>1: bash [141x42] [flags=0x0, references=1, last layout=-1] >> 0: /dev/pts/1 20527 11 36/42, 12020 bytes; UTF-8 0/42, 0 bytes >>2: mutt [141x42] [flags=0x0, references=1, last layout=-1] >> 0: /dev/pts/9 21582 20 42/42, 16635 bytes; UTF-8 0/42, 0 bytes >> 1: uake: 6 windows (created Thu Jun 3 01:56:05 2010) [125x20] [flags=0x0, >> references=0] >>1: weechat-curses [125x20] [flags=0x0, references=1, last layout=-1] >> 0: /dev/pts/3 19031 14 20/20, 10665 bytes; UTF-8 1/20, 550 bytes >>2: bash [125x20] [flags=0x0, references=1, last layout=-1] >> 0: /dev/pts/4 19033 15 40/40, 13290 bytes; UTF-8 0/40, 0 bytes >>3: less [125x20] [flags=0x0, references=1, last layout=-1] >> 0: /dev/pts/5 19036 16 192/199, 28850 bytes; UTF-8 0/199, 0 bytes >>4: bash [125x20] [flags=0x0, references=1, last layout=-1] >> 0: /dev/pts/6 19041 17 1/20, 55 bytes; UTF-8 0/20, 0 bytes >>5: bash [125x20] [flags=0x0, references=1, last layout=-1] >> 0: /dev/pts/7 19048 18 1/20, 55 bytes; UTF-8 0/20, 0 bytes >>6: bash [125x20] [flags=0x0, references=1, last layout=-1] >> 0: /dev/pts/8 19054 19 36/54, 12230 bytes; UTF-8 0/54, 0 bytes >> >> Terminals: >> xterm-color [references=2, flags=0x0]: >> 1: acsc: (string) ``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~ >> 0: AX: [missing] >> 2: bel: (string) \007 >> 3: blink: [missing] >> 4: bold: (string) \033[1m >> 5: civis: [missing] >> 6: clear: (string) \033[H\033[2J >> 7: cnorm: [missing] >> 8: colors: (number) 8 >> 9: csr: (string) \033[%i%p1%d;%p2%dr >> 10: cub: (string) \033[%p1%dD >> 11: cub1: (string) \010 >> 12: cud: (string) \033[%p1%dB >> 13: cud1: (string) \012 >> 14: cuf: (string) \033[%p1%dC >> 15: cuf1: (string) \033[C >> 16: cup: (string) \033[%i%p1%d;%p2%dH >> 17: cuu: (string) \033[%p1%dA >> 18: cuu1: (string) \033[A >> 19: dch: (string) \033[%p1%dP >> 20: dch1: (string) \033[P >> 21: dim: [missing] >> 22: dl: (string) \033[%p1%dM >> 23: dl1: (string) \033[M >> 24: el: (string) \033[K >> 25: el1: [missing] >> 26: enacs: (string) \033)0 >> 27: home: (string) \033[H >> 28: hpa: [missing] >> 29: ich: [missing] >> 30: ich1: [missing] >> 31: il: (string) \033[%p1%dL >> 32: il1: (string) \033[L >> 33: invis: [missing] >> 34: is1: [missing] >> 35: is2: (string) \033[m\033[?7h\033[4l\033>\0337\033[r\03
Weird behavior with SIGWINCH
Hi, I am seeing an issue when resizing the client(urxvt). Text cleared reappears. Steps to reproduce: 1. ls (or any command to produce output) 2. clear the screen with clear 3. Now tile the window horizontally by opening any other applications 4. Now close the newly opened application so that urxvt is now untiled. 5. The ls output reappears with prompt after it in that window. Let me know if more information is needed. This happens with other terminals also(xterm). --- Raghavendra -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing http://p.sf.net/sfu/novell-sfdev2dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCH] Added the capability to capture history to capture-pane command.
Hi, I have been wanting the capability to capture the history and store store it to a file much akin to save-buffer. While checking the sources, I noticed that it had been noticed in TODO to be added with -h to capture-pane. So I have implemented it. I have also tested it myself. %<%<-- Adding -h to capture-pane now captures history of that pane. Signed-off-by: Raghavendra D Prabhu --- cmd-capture-pane.c | 50 -- 1 files changed, 36 insertions(+), 14 deletions(-) diff --git a/cmd-capture-pane.c b/cmd-capture-pane.c index a2c2fdd..1ed0bb3 100644 --- a/cmd-capture-pane.c +++ b/cmd-capture-pane.c @@ -31,8 +31,8 @@ int cmd_capture_pane_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_capture_pane_entry = { "capture-pane", "capturep", - "b:t:", 0, 0, - "[-b buffer-index] [-t target-pane]", + "b:t:h", 0, 0, + "[-b buffer-index] [-t target-pane] [-h capture-history]", 0, NULL, NULL, @@ -47,8 +47,9 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_ctx *ctx) char*buf, *line, *cause; struct screen *s; int buffer; - u_inti, limit; - size_t len, linelen; + u_inti, j, limit; + size_t len, linelen, cellsize; + struct grid* gd; if (cmd_find_pane(ctx, args_get(args, 't'), NULL, &wp) == NULL) return (-1); @@ -57,16 +58,37 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_ctx *ctx) buf = NULL; len = 0; - for (i = 0; i < screen_size_y(s); i++) { - line = grid_view_string_cells(s->grid, 0, i, screen_size_x(s)); - linelen = strlen(line); - - buf = xrealloc(buf, 1, len + linelen + 1); - memcpy(buf + len, line, linelen); - len += linelen; - buf[len++] = '\n'; - - xfree(line); + if (!args_has(args, 'h')) { + for (i = 0; i < screen_size_y(s); i++) { + line = grid_view_string_cells(s->grid, 0, i, screen_size_x(s)); + linelen = strlen(line); + + buf = xrealloc(buf, 1, len + linelen + 1); + memcpy(buf + len, line, linelen); + len += linelen; + buf[len++] = '\n'; + + xfree(line); + } + } else { + gd = s->grid; + line = NULL; + // Looping over the previous history + viewable text + for (i = 0; i < gd->hsize + gd->sy; i++) { + cellsize = gd->linedata[i].cellsize; + line = xrealloc(line,1,cellsize+1); + for (j = 0; j < cellsize; j++) { + line[j] = gd->linedata[i].celldata[j].data; + } + line[cellsize]='\0'; + + buf = xrealloc(buf, 1, len + cellsize + 1); + memcpy(buf + len, line, cellsize); + len += cellsize; + buf[len++] = '\n'; + + } + xfree(line); } limit = options_get_number(&global_options, "buffer-limit"); -- 1.7.4.2 -- Raghavendra Prabhu GPG ID:D72BE977 pgphDl6R3RErJ.pgp Description: PGP signature -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: [PATCH] Added the capability to capture history to capture-pane command.
* On Thu, Mar 31, 2011 at 12:48:00AM +0100, Nicholas Marriott wrote: Hi Thanks, but I'm afraid I already did this a few days ago by giving capture-pane start and end line arguments (it is in OpenBSD I don't think it has made it to SF yet). On Thu, Mar 31, 2011 at 01:15:13AM +0530, Raghavendra D Prabhu wrote: Hi, I have been wanting the capability to capture the history and store store it to a file much akin to save-buffer. While checking the sources, I noticed that it had been noticed in TODO to be added with -h to capture-pane. So I have implemented it. I have also tested it myself. %<%<-- Adding -h to capture-pane now captures history of that pane. Signed-off-by: Raghavendra D Prabhu --- cmd-capture-pane.c | 50 -- 1 files changed, 36 insertions(+), 14 deletions(-) diff --git a/cmd-capture-pane.c b/cmd-capture-pane.c index a2c2fdd..1ed0bb3 100644 --- a/cmd-capture-pane.c +++ b/cmd-capture-pane.c @@ -31,8 +31,8 @@ int cmd_capture_pane_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_capture_pane_entry = { "capture-pane", "capturep", - "b:t:", 0, 0, - "[-b buffer-index] [-t target-pane]", + "b:t:h", 0, 0, + "[-b buffer-index] [-t target-pane] [-h capture-history]", 0, NULL, NULL, @@ -47,8 +47,9 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_ctx *ctx) char*buf, *line, *cause; struct screen *s; int buffer; - u_inti, limit; - size_t len, linelen; + u_inti, j, limit; + size_t len, linelen, cellsize; + struct grid* gd; if (cmd_find_pane(ctx, args_get(args, 't'), NULL, &wp) == NULL) return (-1); @@ -57,16 +58,37 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_ctx *ctx) buf = NULL; len = 0; - for (i = 0; i < screen_size_y(s); i++) { - line = grid_view_string_cells(s->grid, 0, i, screen_size_x(s)); - linelen = strlen(line); - - buf = xrealloc(buf, 1, len + linelen + 1); - memcpy(buf + len, line, linelen); - len += linelen; - buf[len++] = '\n'; - - xfree(line); + if (!args_has(args, 'h')) { + for (i = 0; i < screen_size_y(s); i++) { + line = grid_view_string_cells(s->grid, 0, i, screen_size_x(s)); + linelen = strlen(line); + + buf = xrealloc(buf, 1, len + linelen + 1); + memcpy(buf + len, line, linelen); + len += linelen; + buf[len++] = '\n'; + + xfree(line); + } + } else { + gd = s->grid; + line = NULL; + // Looping over the previous history + viewable text + for (i = 0; i < gd->hsize + gd->sy; i++) { + cellsize = gd->linedata[i].cellsize; + line = xrealloc(line,1,cellsize+1); + for (j = 0; j < cellsize; j++) { + line[j] = gd->linedata[i].celldata[j].data; + } + line[cellsize]='\0'; + + buf = xrealloc(buf, 1, len + cellsize + 1); + memcpy(buf + len, line, cellsize); + len += cellsize; + buf[len++] = '\n'; + + } + xfree(line); } limit = options_get_number(&global_options, "buffer-limit"); -- 1.7.4.2 -- Raghavendra Prabhu GPG ID:D72BE977 -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users Sure, no problem. I have a question regarding the repo: Is the OpenBSD tmux CVS repo maintained separately or are the commits for it go along with others ? Also, can the OpenBSD tmux repo be considered a superset of SF repo (as in all commits which go into SF are already part of OpenBSD repo) ? This will help me in syncing better to avoid this in future. -- Raghavendra Prabhu GPG ID:D72BE977 pgpO6WZg9jq3k.pgp
Highlighting in vi copy mode
Hi, I am quite used to highlighting of search items in vim and it helps quite a lot. Is it possible to have a similar thing in tmux vi-copy mode as well ? I presume the searched item will need to be highlighted with certain terminal capabilities. To illustrate, urxvt currently has it in the form of searchable scrollback but that is quite limited. -- Raghavendra Prabhu GPG Id : D72BE977 Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977 www: wnohang.net pgpeMbt4fy34U.pgp Description: PGP signature -- WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Reverse video
Hi, The reverse-video seems to be broken with tmux. I tried with rxvt-unicode, tmux and TERM=screen-256color that reverse-video as seen in search highlighting in less,man etc is not working. I updated my tmux after sometime so I may be noticing this late. Is this a bug or is there a workaround this ? I tried it the same combination (rxvt .. ) with screen and it works well. -- Raghavendra Prabhu GPG Id : 0xD72BE977 Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977 www: wnohang.net pgpTRiSkhtSHd.pgp Description: PGP signature -- Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Re: Reverse video
* On Tue, Dec 27, 2011 at 06:38:04PM -0200, Tiago Resende wrote: On Wednesday, 2011-12-28, at 00:21:55 +0530, Raghavendra D Prabhu wrote: The reverse-video seems to be broken with tmux. I tried with rxvt-unicode, tmux and TERM=screen-256color that reverse-video as seen in search highlighting in less,man etc is not working. I updated my tmux after sometime so I may be noticing this late. Is this a bug or is there a workaround this ? I tried it the same combination (rxvt .. ) with screen and it works well. You're probably seen italics instead of reverse and your urxvt isn't configured with an italics capable font. Screen makes a mess out of italics and reverse, and tmux doesn't anymore (since 1.5). If you want to know more, you can read about it in our previous discussion here: http://sourceforge.net/mailarchive/forum.php?thread_name=ioag1a%24g2k%241%40dough.gmane.org&forum_name=tmux-users Now you have two choices: a) fix your terminfo entries and get reverse + italics (a bit worksome); or b) just get rid of italics altogether and always get reverse (quite easy). If you choose a), follow the instruction in the FAQ: http://tmux.svn.sourceforge.net/viewvc/tmux/trunk/FAQ It's the last question, titled "vim displays reverse video instead of italics, while less displays italics (or just regular text) instead of reverse. What's wrong?" If you choose b), just add to your .tmux.conf: set -g terminal-overrides 'rxvt-unicode*:sitm@,ritm@' (and don't forget to restart the server) Hope that helps. Cheers. Thank you. I stumbled onto FAQ later. I went with custom terminfo. However, I had some issue with terminfo -- thing is some applications check if it is a 256 terminal by pattern matching against TERM variable for 256color :D So I recreated terminfo with 256color in its name. That fixed it. -- Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users -- Raghavendra Prabhu GPG Id : 0xD72BE977 Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977 www: wnohang.net pgpRwVcW82zEl.pgp Description: PGP signature -- Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Possible bug with libevent-2.0.20
Hi, * On Tue, Aug 28, 2012 at 02:01:15PM +0100, Thomas Adam wrote: Hi, On 28 August 2012 13:43, Vladimir Lomov wrote: I'm using Archlinux x86_64, tmux compiled from SVN, rev. 2860. Recently I updated my system with new kernel, 3.5.3, and libevent, 2.0.20. I rebooted after update and started tmux, after I pressed `Esc' tmux 'crashed', I only see 'lose connection'. The next 'tmux attach' gives message 'no session', simple 'tmux' is ended with message 'detach'. Does it dump core (assuming ulimit is set correctly?) If so, get a stack trace. -- Thomas Adam -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users I can confirm the crash with libevent 2.0.20 (on Archlinux x86_64). Attaching the backtrace. Basically, 532 partial_key: 533 /* 534 * Escape but no key string. If have already seen an escape and the 535 * timer has expired, give up waiting and send the escape. 536 */ 537 if ((tty->flags & TTY_ESCAPE) && 538 !evtimer_pending(&tty->key_timer, NULL)) { 539 evbuffer_drain(tty->event->input, 1); 540 key = '\033'; 541 goto handle_key; 548 if (evtimer_pending(&tty->key_timer, NULL)) The key_timer is uninitialized at the moment which causes the crash. git svn info Path: . URL: https://tmux.svn.sourceforge.net/svnroot/tmux/trunk Repository Root: https://tmux.svn.sourceforge.net/svnroot/tmux Repository UUID: 303bd1e2-03bb-47f1-b221-2a0928954661 Revision: 2789 Node Kind: directory Schedule: normal Last Changed Author: nicm Last Changed Rev: 2789 Last Changed Date: 2012-05-10 11:34:31 +0530 (Thu, 10 May 2012) The commit which seem to have caused seems to be ffaee5ac979129fc10bfe8b98ad8fbbed9705a0a https://tmux.svn.sourceforge.net/svnroot/tmux/trunk@2776 303bd1e2-03bb-47f1-b221-2a0928954661 (which didn't go into tmux 1.6 release I guess) Regards, -- Raghavendra Prabhu GPG Id : 0xD72BE977 Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977 www: wnohang.net pgptiFadLV3V4.pgp Description: PGP signature -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Possible bug with libevent-2.0.20
Hi, * On Wed, Aug 29, 2012 at 06:47:24AM +0530, Raghavendra D Prabhu wrote: Hi, * On Tue, Aug 28, 2012 at 02:01:15PM +0100, Thomas Adam wrote: Hi, On 28 August 2012 13:43, Vladimir Lomov wrote: I'm using Archlinux x86_64, tmux compiled from SVN, rev. 2860. Recently I updated my system with new kernel, 3.5.3, and libevent, 2.0.20. I rebooted after update and started tmux, after I pressed `Esc' tmux 'crashed', I only see 'lose connection'. The next 'tmux attach' gives message 'no session', simple 'tmux' is ended with message 'detach'. Does it dump core (assuming ulimit is set correctly?) If so, get a stack trace. -- Thomas Adam -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users I can confirm the crash with libevent 2.0.20 (on Archlinux x86_64). Attaching the backtrace. Basically, 532 partial_key: Forgot to attach the trace file. Regards, -- Raghavendra Prabhu GPG Id : 0xD72BE977 Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977 www: wnohang.net Program received signal SIGSEGV, Segmentation fault. 0x7f97c121f229 in event_pending () from /lib/libevent-2.0.so.5 #0 0x7f97c121f229 in event_pending () from /lib/libevent-2.0.so.5 #1 0x0043e5de in tty_keys_next (tty=0xbaecc8) at tty-keys.c:548 #2 0x0043fe8d in tty_read_callback (bufev=0xb96990, data=0xbaecc8) at tty.c:166 #3 0x7f97c122c32a in ?? () from /lib/libevent-2.0.so.5 #4 0x7f97c1221944 in event_base_loop () from /lib/libevent-2.0.so.5 #5 0x00433314 in server_loop () at server.c:212 #6 0x004332f8 in server_start (lockfd=6, lockfile=0xb84aa0 "tmux-url") at server.c:203 #7 0x00404b2d in client_connect (path=0x68a620 "/tmp/tmux-1000/default", start_server=1) at client.c:121 #8 0x00404dc5 in client_main (argc=1, argv=0x7fff90722940, flags=1) at client.c:216 #9 0x0043dd7d in main (argc=1, argv=0x7fff90722940) at tmux.c:406 #0 0x7f97c121f229 in event_pending () from /lib/libevent-2.0.so.5 No symbol table info available. #1 0x0043e5de in tty_keys_next (tty=0xbaecc8) at tty-keys.c:548 tk = 0x7f97c1229253 tv = { tv_sec = 140735616785712, tv_usec = 140735617693740 } mouse = { b = 12169520, x = 0, y = 1 } buf = 0xb9b130 "\033[?25l\033[75;1H\033[38;5;2mArchie\033[m\033(B\033[38;5;7m 0 [0]", ' ' , "\033[m\033(B\033[38;5;44m1:zsh*\033[m\033(B\033[38;5;7m", ' ' , "\033[m\033(B\033[38;5;6"... len = 1 size = 0 bspace = 0 '\000' key = 12 delay = 0 #2 0x0043fe8d in tty_read_callback (bufev=0xb96990, data=0xbaecc8) at tty.c:166 tty = 0xbaecc8 #3 0x7f97c122c32a in ?? () from /lib/libevent-2.0.so.5 No symbol table info available. #4 0x7f97c1221944 in event_base_loop () from /lib/libevent-2.0.so.5 No symbol table info available. #5 0x00433314 in server_loop () at server.c:212 No locals. #6 0x004332f8 in server_start (lockfd=6, lockfile=0xb84aa0 "tmux-url") at server.c:203 wp = 0x68a620 pair = {7, 8} cause = 0x6b636f6c2e746c75 tv = { tv_sec = 1, tv_usec = 0 } i = 32663 __func__ = "server_start" #7 0x00404b2d in client_connect (path=0x68a620 "/tmp/tmux-1000/default", start_server=1) at client.c:121 sa = { sun_family = 1, sun_path = "/tmp/tmux-1000/default", '\000' } size = 22 fd = 6 lockfd = 6 lockfile = 0xb84aa0 "tmux-url" __func__ = "client_connect" #8 0x00404dc5 in client_main (argc=1, argv=0x7fff90722940, flags=1) at client.c:216 cmd = 0x0 cmdlist = 0xb84ae0 cmddata = { pid = 0, idx = 0, argc = 0, argv = "\006", '\000' , " \000\000\000\000\000\000\000\000\344z$\301\227\177\000\000\000\000\000\000\377\377\377\377", '\000' , "\n", '\000' , "\001\000\000\000\000\000\000\000\240\367E\000\000\000\000\000\377\377\377\377\377\377\377\377\\\024\001\000\000\000\000\000\030\000\000\000\060\000\000\000\060'r\220\377\177\000\000p&
[PATCH 2/6] If select-window is invoked on same window as current, switch to previous window.
This is to simulate a behavior similar to what is found in window managers where using the same key used to switched to the workspace returns to previous workspace; since this allows faster switching (by making use of locality of the key). Signed-off-by: Raghavendra D Prabhu --- cmd-select-window.c | 13 + 1 file changed, 13 insertions(+) diff --git a/cmd-select-window.c b/cmd-select-window.c index 5d87e59..103fd5b 100644 --- a/cmd-select-window.c +++ b/cmd-select-window.c @@ -130,7 +130,20 @@ cmd_select_window_exec(struct cmd *self, struct cmd_ctx *ctx) if (wl == NULL) return (CMD_RETURN_ERROR); + /* +* If select-window is invoked on same window as current, switch +* to previous window +*/ + if (wl == s->curw) { + if (session_last(s) != 0) { + ctx->error(ctx, "no last window"); + return (-1); + } + goto redraw; + } + if (session_select(s, wl->idx) == 0) +redraw: server_redraw_session(s); } recalculate_sizes(); -- 1.8.0 -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCH 0/6] Assorted tmux patchset
Following are the patches that add/extend some of the features. They are also tested. Raghavendra D Prabhu (6): Add a simpler option to capture the entire pane If select-window is invoked on same window as current, switch to previous window. Man page update for extended behavior of select-window. Add 'choice-characters' to define the characters in choice-mode. Add option 'choose-tree-collapse'. Allow '$' and '^' in select-window index. cmd-capture-pane.c | 81 - cmd-select-window.c | 13 + cmd.c | 10 +++ options-table.c | 12 tmux.1 | 4 +++ window-choose.c | 18 ++-- 6 files changed, 92 insertions(+), 46 deletions(-) -- 1.8.0 -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCH 6/6] Allow '$' and '^' in select-window index.
This allows one to select the last window (not last-window but window with highest index), so one can bind it to 'select-window -t:$' to jump to the end window, and similary bind to 'select-window -t:^' to jump to the first window (first determined by base-index). Signed-off-by: Raghavendra D Prabhu --- cmd.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/cmd.c b/cmd.c index 4a17ddc..35dadc1 100644 --- a/cmd.c +++ b/cmd.c @@ -592,6 +592,16 @@ cmd_lookup_window(struct session *s, const char *name, int *ambiguous) if ((wl = cmd_lookup_winlink_windowid(s, name)) != NULL) return (wl); + if (*name == '$') { + if ((wlfound = RB_MAX(winlinks, &s->windows)) != NULL) + return (wlfound); + } + + if (*name == '^') { + if ((wlfound = RB_MIN(winlinks, &s->windows)) != NULL) + return (wlfound); + } + /* First see if this is a valid window index in this session. */ idx = strtonum(name, 0, INT_MAX, &errstr); if (errstr == NULL) { -- 1.8.0 -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCH 1/6] Add a simpler option to capture the entire pane
Adds a '-h' option to capture the entire pane without providing the appropriate co-ordinates. Signed-off-by: Raghavendra D Prabhu --- cmd-capture-pane.c | 81 +- 1 file changed, 43 insertions(+), 38 deletions(-) diff --git a/cmd-capture-pane.c b/cmd-capture-pane.c index a94c717..11c4367 100644 --- a/cmd-capture-pane.c +++ b/cmd-capture-pane.c @@ -31,8 +31,8 @@ enum cmd_retvalcmd_capture_pane_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_capture_pane_entry = { "capture-pane", "capturep", - "b:E:S:t:", 0, 0, - "[-b buffer-index] [-E end-line] [-S start-line] [-t target-pane]", + "b:E:S:t:h", 0, 0, + "[-b buffer-index] [-E end-line] [-S start-line] [-t target-pane] [-h ]", 0, NULL, NULL, @@ -59,44 +59,49 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_ctx *ctx) buf = NULL; len = 0; - n = args_strtonum(args, 'S', INT_MIN, SHRT_MAX, &cause); - if (cause != NULL) { - top = gd->hsize; - free(cause); - } else if (n < 0 && (u_int) -n > gd->hsize) + if (args_has(args, 'h')) { top = 0; - else - top = gd->hsize + n; - if (top > gd->hsize + gd->sy - 1) - top = gd->hsize + gd->sy - 1; - - n = args_strtonum(args, 'E', INT_MIN, SHRT_MAX, &cause); - if (cause != NULL) { - bottom = gd->hsize + gd->sy - 1; - free(cause); - } else if (n < 0 && (u_int) -n > gd->hsize) - bottom = 0; - else - bottom = gd->hsize + n; - if (bottom > gd->hsize + gd->sy - 1) bottom = gd->hsize + gd->sy - 1; - - if (bottom < top) { - tmp = bottom; - bottom = top; - top = tmp; - } - - for (i = top; i <= bottom; i++) { - line = grid_string_cells(s->grid, 0, i, screen_size_x(s)); - linelen = strlen(line); - - buf = xrealloc(buf, 1, len + linelen + 1); - memcpy(buf + len, line, linelen); - len += linelen; - buf[len++] = '\n'; - - free(line); + } else { + n = args_strtonum(args, 'S', INT_MIN, SHRT_MAX, &cause); + if (cause != NULL) { + top = gd->hsize; + free(cause); + } else if (n < 0 && (u_int) -n > gd->hsize) + top = 0; + else + top = gd->hsize + n; + if (top > gd->hsize + gd->sy - 1) + top = gd->hsize + gd->sy - 1; + + n = args_strtonum(args, 'E', INT_MIN, SHRT_MAX, &cause); + if (cause != NULL) { + bottom = gd->hsize + gd->sy - 1; + free(cause); + } else if (n < 0 && (u_int) -n > gd->hsize) + bottom = 0; + else + bottom = gd->hsize + n; + if (bottom > gd->hsize + gd->sy - 1) + bottom = gd->hsize + gd->sy - 1; + + if (bottom < top) { + tmp = bottom; + bottom = top; + top = tmp; + } + + for (i = top; i <= bottom; i++) { + line = grid_string_cells(s->grid, 0, i, screen_size_x(s)); + linelen = strlen(line); + + buf = xrealloc(buf, 1, len + linelen + 1); + memcpy(buf + len, line, linelen); + len += linelen; + buf[len++] = '\n'; + + free(line); + } } limit = options_get_number(&global_options, "buffer-limit"); -- 1.8.0 -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCH 3/6] Man page update for extended behavior of select-window.
Updates the man-page for select-window to include the new behavior. Signed-off-by: Raghavendra D Prabhu --- tmux.1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tmux.1 b/tmux.1 index 213db74..7f081c0 100644 --- a/tmux.1 +++ b/tmux.1 @@ -1643,6 +1643,8 @@ command. .D1 (alias: Ic selectw ) Select the window at .Ar target-window . +Invoking select-window on same window as current window chooses last-window and +toggle betweens them in future runs. .Fl l , .Fl n and -- 1.8.0 -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCH 5/6] Add option 'choose-tree-collapse'.
choose-tree, by default, folds/collapses the window tree grouped by session. This adds an option to make it configurable. Signed-off-by: Raghavendra D Prabhu --- options-table.c | 5 + window-choose.c | 5 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/options-table.c b/options-table.c index c2ef30c..1fc0b00 100644 --- a/options-table.c +++ b/options-table.c @@ -115,6 +115,11 @@ const struct options_table_entry session_options_table[] = { "ABCDEFGHIJKLMNOPQRSTUVWXYZ" }, + { .name = "choose-tree-collapse", + .type = OPTIONS_TABLE_FLAG, + .default_num = 1 + }, + { .name = "default-command", .type = OPTIONS_TABLE_STRING, .default_str = "" diff --git a/window-choose.c b/window-choose.c index 3368c66..9d6b3f8 100644 --- a/window-choose.c +++ b/window-choose.c @@ -107,6 +107,8 @@ window_choose_ready(struct window_pane *wp, u_int cur, { struct window_choose_mode_data *data = wp->modedata; struct screen *s = &data->screen; + struct options *oo = &global_s_options; + int collapse = options_get_number(oo, "choose-tree-collapse"); data->selected = cur; if (data->selected > screen_size_y(s) - 1) @@ -117,7 +119,8 @@ window_choose_ready(struct window_pane *wp, u_int cur, ARRAY_CONCAT(&data->old_list, &data->list); - window_choose_collapse_all(wp); + if (collapse) + window_choose_collapse_all(wp); window_choose_redraw_screen(wp); } -- 1.8.0 -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCH 4/6] Add 'choice-characters' to define the characters in choice-mode.
The characters used in choice-mode are hardcoded. This option allows one to use custom characters (and order) based on one's preference. Also, added description to the man page. Signed-off-by: Raghavendra D Prabhu --- options-table.c | 7 +++ tmux.1 | 2 ++ window-choose.c | 13 ++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/options-table.c b/options-table.c index 8ce838a..c2ef30c 100644 --- a/options-table.c +++ b/options-table.c @@ -108,6 +108,13 @@ const struct options_table_entry session_options_table[] = { .default_num = 0 }, + { .name = "choice-characters", + .type = OPTIONS_TABLE_STRING, + .default_str = "0123456789" +"abcdefghijklmnopqrstuvwxyz" +"ABCDEFGHIJKLMNOPQRSTUVWXYZ" + }, + { .name = "default-command", .type = OPTIONS_TABLE_STRING, .default_str = "" diff --git a/tmux.1 b/tmux.1 index 7f081c0..adb2a27 100644 --- a/tmux.1 +++ b/tmux.1 @@ -2046,6 +2046,8 @@ window of that session, means all bells are ignored and .Ic current means only bells in windows other than the current window are ignored. +.It Ic choice-characters Ar string +String of characters which will be used for selecting in choice-mode. .It Xo Ic bell-on-alert .Op Ic on | off .Xc diff --git a/window-choose.c b/window-choose.c index 5bcca17..3368c66 100644 --- a/window-choose.c +++ b/window-choose.c @@ -702,10 +702,9 @@ window_choose_write_line( int window_choose_key_index(struct window_choose_mode_data *data, u_int idx) { - static const char keys[] = "0123456789" -"abcdefghijklmnopqrstuvwxyz" -"ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - const char *ptr; + struct options *oo = &global_s_options; + char*keys = options_get_string(oo, "choice-characters"); + const char *ptr; int mkey; for (ptr = keys; *ptr != '\0'; ptr++) { @@ -721,9 +720,9 @@ window_choose_key_index(struct window_choose_mode_data *data, u_int idx) int window_choose_index_key(struct window_choose_mode_data *data, int key) { - static const char keys[] = "0123456789" -"abcdefghijklmnopqrstuvwxyz" -"ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + struct options *oo = &global_s_options; + char*keys = options_get_string(oo, "choice-characters"); + const char *ptr; int mkey; u_int idx = 0; -- 1.8.0 -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Re: [PATCH 0/6] Assorted tmux patchset
Hi, * On Mon, Dec 10, 2012 at 11:20:33PM +, Thomas Adam wrote: Hi, On Sat, Nov 17, 2012 at 11:42:02PM +0530, Raghavendra D Prabhu wrote: Following are the patches that add/extend some of the features. They are also tested. Given some feedback on the patches you sent out, were you planning on looking at any of the patches? -- Thomas Adam Sorry for the delay (I was away), I will revert back on them. Regards, -- Raghavendra Prabhu pgpRNk9ZUzWT0.pgp Description: PGP signature -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Re: [PATCH 4/6] Add 'choice-characters' to define the characters in choice-mode.
Hi, * On Sat, Nov 17, 2012 at 06:38:38PM +, Thomas Adam wrote: M +0530, Raghavendra D Prabhu wrote: The characters used in choice-mode are hardcoded. This option allows one to use custom characters (and order) based on one's preference. Also, added description to the man page. Signed-off-by: Raghavendra D Prabhu --- options-table.c | 7 +++ tmux.1 | 2 ++ window-choose.c | 13 ++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/options-table.c b/options-table.c index 8ce838a..c2ef30c 100644 --- a/options-table.c +++ b/options-table.c @@ -108,6 +108,13 @@ const struct options_table_entry session_options_table[] = { .default_num = 0 }, + { .name = "choice-characters", + .type = OPTIONS_TABLE_STRING, + .default_str = "0123456789" +"abcdefghijklmnopqrstuvwxyz" +"ABCDEFGHIJKLMNOPQRSTUVWXYZ" + }, + This ability breaks how choice-mode then goes on to number other items once the choice-characters have been used up. Since the behaviour is to keep numbering the entries after the last one, if you do: set -g choice-characters "1 3 0 9 2" amd then look at, say, choose-tree, you'll find the sequence very strange indeed. Not to mention you cannot guarantee, even with the ordering here, that you'll never get duplicate entries, making the entire point of pressing a letter to go to a key-binding redundant. Yes, with only 5 characters you can hit the duplicates very fast, however, with the default value you should hit it after 62 windows, so there is a limit anyways. I currently use this set -g choice-characters 'qwerasdfzxcv123~[]\;/=-l,.hjkiopnm' So, yes, it is necessary to set this higher to avoid duplicates. Hmm... so I wonder now, whether this is worth it. The assignment of letters and numbers here, to denote the items which you can select with a key-binding is always deterministic, and if you go beyond the default, then you're prompted for selection anyway. Why is this patch useful to you, out of interest? I like to use alphabets to choose windows (since I do so in other environments like pentadactyl -- using letters for hints), it is just out of habit - others may have their own preferences. -- Thomas Adam Regards, -- Raghavendra Prabhu GPG Id : 0xD72BE977 Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977 www: wnohang.net pgpiIPVYszacz.pgp Description: PGP signature -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Re: [PATCH 6/6] Allow '$' and '^' in select-window index.
Hi, * On Sat, Nov 17, 2012 at 06:22:38PM +, Thomas Adam wrote: +0530, Raghavendra D Prabhu wrote: This allows one to select the last window (not last-window but window with highest index), so one can bind it to 'select-window -t:$' to jump to the end window, and similary bind to 'select-window -t:^' to jump to the first window (first determined by base-index). Signed-off-by: Raghavendra D Prabhu --- cmd.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/cmd.c b/cmd.c index 4a17ddc..35dadc1 100644 --- a/cmd.c +++ b/cmd.c @@ -592,6 +592,16 @@ cmd_lookup_window(struct session *s, const char *name, int *ambiguous) if ((wl = cmd_lookup_winlink_windowid(s, name)) != NULL) return (wl); + if (*name == '$') { + if ((wlfound = RB_MAX(winlinks, &s->windows)) != NULL) + return (wlfound); + } + + if (*name == '^') { + if ((wlfound = RB_MIN(winlinks, &s->windows)) != NULL) + return (wlfound); + } + Don't you want this check to be in cmd.c:cmd_find_window() instead? That way it groups logically with the other window lookup characters which can be used. -- Thomas Adam You are right, I will move it there. Regards, -- Raghavendra Prabhu GPG Id : 0xD72BE977 Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977 www: wnohang.net pgpXx0zVYnACf.pgp Description: PGP signature -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Re: [PATCH 2/6] If select-window is invoked on same window as current, switch to previous window.
Hi, * On Mon, Nov 19, 2012 at 10:54:22AM +, Nicholas Marriott wrote: n't like this behaviour at all, sorry. If you really want it make it a flag to select-window. Thanks, I will make it like that. Also don't goto the inside of if statements! I will fix this as well. On Sat, Nov 17, 2012 at 11:42:04PM +0530, Raghavendra D Prabhu wrote: This is to simulate a behavior similar to what is found in window managers where using the same key used to switched to the workspace returns to previous workspace; since this allows faster switching (by making use of locality of the key). Signed-off-by: Raghavendra D Prabhu --- cmd-select-window.c | 13 + 1 file changed, 13 insertions(+) diff --git a/cmd-select-window.c b/cmd-select-window.c index 5d87e59..103fd5b 100644 --- a/cmd-select-window.c +++ b/cmd-select-window.c @@ -130,7 +130,20 @@ cmd_select_window_exec(struct cmd *self, struct cmd_ctx *ctx) if (wl == NULL) return (CMD_RETURN_ERROR); + /* +* If select-window is invoked on same window as current, switch +* to previous window +*/ + if (wl == s->curw) { + if (session_last(s) != 0) { + ctx->error(ctx, "no last window"); + return (-1); + } + goto redraw; + } + if (session_select(s, wl->idx) == 0) +redraw: server_redraw_session(s); } recalculate_sizes(); -- 1.8.0 -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users Regards, -- Raghavendra Prabhu GPG Id : 0xD72BE977 Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977 www: wnohang.net pgpTEFA65fdBL.pgp Description: PGP signature -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Re: [PATCH 5/6] Add option 'choose-tree-collapse'.
Hi, * On Mon, Nov 19, 2012 at 10:55:42AM +, Nicholas Marriott wrote: 12 Please make this a flag to choose-tree, not a tmux option. Also don't forget the man page. Ah, yes, making it an option sounds superfluous, will make it a flag. Thanks. Thanks On Sat, Nov 17, 2012 at 11:42:07PM +0530, Raghavendra D Prabhu wrote: choose-tree, by default, folds/collapses the window tree grouped by session. This adds an option to make it configurable. Signed-off-by: Raghavendra D Prabhu --- options-table.c | 5 + window-choose.c | 5 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/options-table.c b/options-table.c index c2ef30c..1fc0b00 100644 --- a/options-table.c +++ b/options-table.c @@ -115,6 +115,11 @@ const struct options_table_entry session_options_table[] = { "ABCDEFGHIJKLMNOPQRSTUVWXYZ" }, + { .name = "choose-tree-collapse", + .type = OPTIONS_TABLE_FLAG, + .default_num = 1 + }, + { .name = "default-command", .type = OPTIONS_TABLE_STRING, .default_str = "" diff --git a/window-choose.c b/window-choose.c index 3368c66..9d6b3f8 100644 --- a/window-choose.c +++ b/window-choose.c @@ -107,6 +107,8 @@ window_choose_ready(struct window_pane *wp, u_int cur, { struct window_choose_mode_data *data = wp->modedata; struct screen *s = &data->screen; + struct options *oo = &global_s_options; + int collapse = options_get_number(oo, "choose-tree-collapse"); data->selected = cur; if (data->selected > screen_size_y(s) - 1) @@ -117,7 +119,8 @@ window_choose_ready(struct window_pane *wp, u_int cur, ARRAY_CONCAT(&data->old_list, &data->list); - window_choose_collapse_all(wp); + if (collapse) + window_choose_collapse_all(wp); window_choose_redraw_screen(wp); } -- 1.8.0 -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-use Regards, -- Raghavendra Prabhu GPG Id : 0xD72BE977 Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977 www: wnohang.net pgpIHfptxcxBf.pgp Description: PGP signature -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Re: [PATCH 4/6] Add 'choice-characters' to define the characters in choice-mode.
Hi, * On Fri, Dec 14, 2012 at 11:06:18PM +, Thomas Adam wrote: Hi, On 14 December 2012 21:47, Raghavendra D Prabhu wrote: Yes, with only 5 characters you can hit the duplicates very fast, however, with the default value you should hit it after 62 windows, so there is a limit anyways. I currently use this set -g choice-characters 'qwerasdfzxcv123~[]\;/=-l,.hjkiopnm' So, yes, it is necessary to set this higher to avoid duplicates. Which makes it programatically impossible to ensure an inherent ordering when rendering items in choose-mode which do not conflict. I am not sure that I understand the 'conflict' part -- if the keys specified in the string conflict with other key bindings of that mode, they are skipped (somewhere in the code it checks for that) and rest are used. I consider this patch to be somewhat bloatful whilst potentially causing existing users problems. Since the default value when not set is same as the value now, it shouldn't cause issues to those don't set it. I do appreciate that this might be useful to some people, but currently with the way things stand, we have a selection system which works and I'd rather keep it that way. Kindly, -- Thomas Adam -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users Regards, -- Raghavendra Prabhu GPG Id : 0xD72BE977 Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977 www: wnohang.net pgp2cSGeCVbzp.pgp Description: PGP signature -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCHv2 1/6] Add a simpler option to capture the entire pane
Adds a '-h' option to capture the entire pane without providing the appropriate co-ordinates. Signed-off-by: Raghavendra D Prabhu diff --git a/cmd-capture-pane.c b/cmd-capture-pane.c index a94c717..11c4367 100644 --- a/cmd-capture-pane.c +++ b/cmd-capture-pane.c @@ -31,8 +31,8 @@ enum cmd_retvalcmd_capture_pane_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_capture_pane_entry = { "capture-pane", "capturep", - "b:E:S:t:", 0, 0, - "[-b buffer-index] [-E end-line] [-S start-line] [-t target-pane]", + "b:E:S:t:h", 0, 0, + "[-b buffer-index] [-E end-line] [-S start-line] [-t target-pane] [-h ]", 0, NULL, NULL, @@ -59,44 +59,49 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_ctx *ctx) buf = NULL; len = 0; - n = args_strtonum(args, 'S', INT_MIN, SHRT_MAX, &cause); - if (cause != NULL) { - top = gd->hsize; - free(cause); - } else if (n < 0 && (u_int) -n > gd->hsize) + if (args_has(args, 'h')) { top = 0; - else - top = gd->hsize + n; - if (top > gd->hsize + gd->sy - 1) - top = gd->hsize + gd->sy - 1; - - n = args_strtonum(args, 'E', INT_MIN, SHRT_MAX, &cause); - if (cause != NULL) { - bottom = gd->hsize + gd->sy - 1; - free(cause); - } else if (n < 0 && (u_int) -n > gd->hsize) - bottom = 0; - else - bottom = gd->hsize + n; - if (bottom > gd->hsize + gd->sy - 1) bottom = gd->hsize + gd->sy - 1; - - if (bottom < top) { - tmp = bottom; - bottom = top; - top = tmp; - } - - for (i = top; i <= bottom; i++) { - line = grid_string_cells(s->grid, 0, i, screen_size_x(s)); - linelen = strlen(line); - - buf = xrealloc(buf, 1, len + linelen + 1); - memcpy(buf + len, line, linelen); - len += linelen; - buf[len++] = '\n'; - - free(line); + } else { + n = args_strtonum(args, 'S', INT_MIN, SHRT_MAX, &cause); + if (cause != NULL) { + top = gd->hsize; + free(cause); + } else if (n < 0 && (u_int) -n > gd->hsize) + top = 0; + else + top = gd->hsize + n; + if (top > gd->hsize + gd->sy - 1) + top = gd->hsize + gd->sy - 1; + + n = args_strtonum(args, 'E', INT_MIN, SHRT_MAX, &cause); + if (cause != NULL) { + bottom = gd->hsize + gd->sy - 1; + free(cause); + } else if (n < 0 && (u_int) -n > gd->hsize) + bottom = 0; + else + bottom = gd->hsize + n; + if (bottom > gd->hsize + gd->sy - 1) + bottom = gd->hsize + gd->sy - 1; + + if (bottom < top) { + tmp = bottom; + bottom = top; + top = tmp; + } + + for (i = top; i <= bottom; i++) { + line = grid_string_cells(s->grid, 0, i, screen_size_x(s)); + linelen = strlen(line); + + buf = xrealloc(buf, 1, len + linelen + 1); + memcpy(buf + len, line, linelen); + len += linelen; + buf[len++] = '\n'; + + free(line); + } } limit = options_get_number(&global_options, "buffer-limit"); -- 1.8.0.2 -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCHv2 3/6] Add 'choice-characters' to define the characters in choice-mode.
The characters used in choice-mode are hardcoded. This option allows one to use custom characters (and order) based on one's preference. Also, added description to the man page. Signed-off-by: Raghavendra D Prabhu diff --git a/options-table.c b/options-table.c index 8ce838a..c2ef30c 100644 --- a/options-table.c +++ b/options-table.c @@ -108,6 +108,13 @@ const struct options_table_entry session_options_table[] = { .default_num = 0 }, + { .name = "choice-characters", + .type = OPTIONS_TABLE_STRING, + .default_str = "0123456789" +"abcdefghijklmnopqrstuvwxyz" +"ABCDEFGHIJKLMNOPQRSTUVWXYZ" + }, + { .name = "default-command", .type = OPTIONS_TABLE_STRING, .default_str = "" diff --git a/tmux.1 b/tmux.1 index 20a61af..2a91658 100644 --- a/tmux.1 +++ b/tmux.1 @@ -2050,6 +2050,8 @@ window of that session, means all bells are ignored and .Ic current means only bells in windows other than the current window are ignored. +.It Ic choice-characters Ar string +String of characters which will be used for selecting in choice-mode. .It Xo Ic bell-on-alert .Op Ic on | off .Xc diff --git a/window-choose.c b/window-choose.c index 5bcca17..3368c66 100644 --- a/window-choose.c +++ b/window-choose.c @@ -702,10 +702,9 @@ window_choose_write_line( int window_choose_key_index(struct window_choose_mode_data *data, u_int idx) { - static const char keys[] = "0123456789" -"abcdefghijklmnopqrstuvwxyz" -"ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - const char *ptr; + struct options *oo = &global_s_options; + char*keys = options_get_string(oo, "choice-characters"); + const char *ptr; int mkey; for (ptr = keys; *ptr != '\0'; ptr++) { @@ -721,9 +720,9 @@ window_choose_key_index(struct window_choose_mode_data *data, u_int idx) int window_choose_index_key(struct window_choose_mode_data *data, int key) { - static const char keys[] = "0123456789" -"abcdefghijklmnopqrstuvwxyz" -"ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + struct options *oo = &global_s_options; + char*keys = options_get_string(oo, "choice-characters"); + const char *ptr; int mkey; u_int idx = 0; -- 1.8.0.2 -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCHv2 0/6] Assorted tmux patchset
Following are the patches that add/extend some of the features. They are also tested. Revision 1: Initial patchset. Revision 2: Made changes/improvements suggested by reviewers. Also added another patch fixing a bug, also rebased over latest tmux HEAD. Raghavendra D Prabhu (6): Add a simpler option to capture the entire pane Added 'T' flag for select-window wherein if select-window is invoked on same window as current, it switches to previous window. Add 'choice-characters' to define the characters in choice-mode. Add flag 'u' to choose-tree to uncollapse tree by default. Allow '$' and '^' in select-window index. Remove the extra window_choose_redraw_screen. -- 1.8.0.2 -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCHv2 2/6] Added 'T' flag for select-window wherein if select-window is invoked on same window as current, it switches to previous window.
This is to simulate a behavior similar to what is found in window managers where using the same key used to switched to the workspace returns to previous workspace; since this allows faster switching (by making use of locality of the key). To keep the existing default behavior, added as a flag 'T' to select-window. Also updated the man-page for select-window to include the new flag 'T'. Signed-off-by: Raghavendra D Prabhu diff --git a/cmd-select-window.c b/cmd-select-window.c index 5d87e59..d62c1be 100644 --- a/cmd-select-window.c +++ b/cmd-select-window.c @@ -31,8 +31,8 @@ enum cmd_retvalcmd_select_window_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_select_window_entry = { "select-window", "selectw", - "lnpt:", 0, 0, - "[-lnp] " CMD_TARGET_WINDOW_USAGE, + "lnpTt:", 0, 0, + "[-lnpT] " CMD_TARGET_WINDOW_USAGE, 0, cmd_select_window_key_binding, NULL, @@ -130,7 +130,17 @@ cmd_select_window_exec(struct cmd *self, struct cmd_ctx *ctx) if (wl == NULL) return (CMD_RETURN_ERROR); - if (session_select(s, wl->idx) == 0) + /* +* If select-window is invoked on same window as current, switch +* to previous window +*/ + if (args_has(self->args, 'T') && wl == s->curw) { + if (session_last(s) != 0) { + ctx->error(ctx, "no last window"); + return (-1); + } + server_redraw_session(s); + } else if (session_select(s, wl->idx) == 0) server_redraw_session(s); } recalculate_sizes(); diff --git a/tmux.1 b/tmux.1 index 213db74..20a61af 100644 --- a/tmux.1 +++ b/tmux.1 @@ -1637,12 +1637,18 @@ is the same as using the .Ic last-pane command. .It Xo Ic select-window -.Op Fl lnp +.Op Fl lnpT .Op Fl t Ar target-window .Xc .D1 (alias: Ic selectw ) Select the window at .Ar target-window . +If invoked with +.Fl T +on same window as current window alongside +.Fl t, +it chooses last-window and +toggle betweens them in future runs. .Fl l , .Fl n and -- 1.8.0.2 -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCHv2 4/6] Add flag 'u' to choose-tree to uncollapse tree by default.
choose-tree, by default, folds/collapses the window tree grouped by session. This adds a flag 'u' to uncollapse it by default. Signed-off-by: Raghavendra D Prabhu diff --git a/cmd-choose-tree.c b/cmd-choose-tree.c index e8da7a4..65d88a8 100644 --- a/cmd-choose-tree.c +++ b/cmd-choose-tree.c @@ -39,8 +39,8 @@ void cmd_choose_tree_free(struct window_choose_data *); const struct cmd_entry cmd_choose_tree_entry = { "choose-tree", NULL, - "S:W:swb:c:t:", 0, 1, - "[-sw] [-b session-template] [-c window template] [-S format] " \ + "S:W:swub:c:t:", 0, 1, + "[-swu] [-b session-template] [-c window template] [-S format] " \ "[-W format] " CMD_TARGET_WINDOW_USAGE, 0, NULL, @@ -232,6 +232,10 @@ windows_only: window_choose_ready(wl->window->active, cur_win, cmd_choose_tree_callback, cmd_choose_tree_free); + if (args_has(args, 'u')) { + window_choose_expand_all(wl->window->active); + } + return (CMD_RETURN_NORMAL); } diff --git a/tmux.1 b/tmux.1 index 2a91658..bd1e334 100644 --- a/tmux.1 +++ b/tmux.1 @@ -1124,6 +1124,7 @@ This command works only from inside .Ic choose-tree .Op Fl s .Op Fl w +.Op Fl u .Op Fl b Ar session-template .Op Fl c Ar window-template .Op Fl S Ar format @@ -1149,6 +1150,9 @@ If .Fl w is given, will show windows. If +.Fl u +is given, the tree is uncollapsed by default. +If .Fl b is given, will override the default session command. Note that -- 1.8.0.2 -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCHv2 5/6] Allow '$' and '^' in select-window index.
This allows one to select the last window (not last-window but window with highest index), so one can bind it to 'select-window -t:$' to jump to the end window, and similary bind to 'select-window -t:^' to jump to the first window (first determined by base-index). Signed-off-by: Raghavendra D Prabhu diff --git a/cmd.c b/cmd.c index 4a17ddc..0077555 100644 --- a/cmd.c +++ b/cmd.c @@ -850,6 +850,10 @@ cmd_find_window(struct cmd_ctx *ctx, const char *arg, struct session **sp) wl = s->curw; else if (winptr[0] == '!' && winptr[1] == '\0') wl = TAILQ_FIRST(&s->lastw); + else if (winptr[0] == '^' && winptr[1] == '\0') + wl = RB_MIN(winlinks, &s->windows); + else if (winptr[0] == '$' && winptr[1] == '\0') + wl = RB_MAX(winlinks, &s->windows); else if (winptr[0] == '+' || winptr[0] == '-') wl = cmd_find_window_offset(winptr, s, &ambiguous); else -- 1.8.0.2 -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCHv2 6/6] Remove the extra window_choose_redraw_screen.
window_choose_collapse_all already calls window_choose_redraw_screen, hence removing it from window_choose_ready. Signed-off-by: Raghavendra D Prabhu diff --git a/window-choose.c b/window-choose.c index 3368c66..686e97f 100644 --- a/window-choose.c +++ b/window-choose.c @@ -118,7 +118,6 @@ window_choose_ready(struct window_pane *wp, u_int cur, ARRAY_CONCAT(&data->old_list, &data->list); window_choose_collapse_all(wp); - window_choose_redraw_screen(wp); } struct screen * -- 1.8.0.2 -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: [PATCHv2 1/6] Add a simpler option to capture the entire pane
Hi, This patch had a slight editing error. Corrected it. (patch will be in the reply to this.) * On Sat, Dec 15, 2012 at 05:32:16AM +0530, Raghavendra D Prabhu wrote: Adds a '-h' option to capture the entire pane without providing the appropriate co-ordinates. Signed-off-by: Raghavendra D Prabhu diff --git a/cmd-capture-pane.c b/cmd-capture-pane.c index a94c717..11c4367 100644 --- a/cmd-capture-pane.c +++ b/cmd-capture-pane.c @@ -31,8 +31,8 @@ enum cmd_retvalcmd_capture_pane_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_capture_pane_entry = { "capture-pane", "capturep", - "b:E:S:t:", 0, 0, - "[-b buffer-index] [-E end-line] [-S start-line] [-t target-pane]", + "b:E:S:t:h", 0, 0, + "[-b buffer-index] [-E end-line] [-S start-line] [-t target-pane] [-h ]", 0, NULL, NULL, @@ -59,44 +59,49 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_ctx *ctx) buf = NULL; len = 0; - n = args_strtonum(args, 'S', INT_MIN, SHRT_MAX, &cause); - if (cause != NULL) { - top = gd->hsize; - free(cause); - } else if (n < 0 && (u_int) -n > gd->hsize) + if (args_has(args, 'h')) { top = 0; - else - top = gd->hsize + n; - if (top > gd->hsize + gd->sy - 1) - top = gd->hsize + gd->sy - 1; - - n = args_strtonum(args, 'E', INT_MIN, SHRT_MAX, &cause); - if (cause != NULL) { - bottom = gd->hsize + gd->sy - 1; - free(cause); - } else if (n < 0 && (u_int) -n > gd->hsize) - bottom = 0; - else - bottom = gd->hsize + n; - if (bottom > gd->hsize + gd->sy - 1) bottom = gd->hsize + gd->sy - 1; - - if (bottom < top) { - tmp = bottom; - bottom = top; - top = tmp; - } - - for (i = top; i <= bottom; i++) { - line = grid_string_cells(s->grid, 0, i, screen_size_x(s)); - linelen = strlen(line); - - buf = xrealloc(buf, 1, len + linelen + 1); - memcpy(buf + len, line, linelen); - len += linelen; - buf[len++] = '\n'; - - free(line); + } else { + n = args_strtonum(args, 'S', INT_MIN, SHRT_MAX, &cause); + if (cause != NULL) { + top = gd->hsize; + free(cause); + } else if (n < 0 && (u_int) -n > gd->hsize) + top = 0; + else + top = gd->hsize + n; + if (top > gd->hsize + gd->sy - 1) + top = gd->hsize + gd->sy - 1; + + n = args_strtonum(args, 'E', INT_MIN, SHRT_MAX, &cause); + if (cause != NULL) { + bottom = gd->hsize + gd->sy - 1; + free(cause); + } else if (n < 0 && (u_int) -n > gd->hsize) + bottom = 0; + else + bottom = gd->hsize + n; + if (bottom > gd->hsize + gd->sy - 1) + bottom = gd->hsize + gd->sy - 1; + + if (bottom < top) { + tmp = bottom; + bottom = top; + top = tmp; + } + + for (i = top; i <= bottom; i++) { + line = grid_string_cells(s->grid, 0, i, screen_size_x(s)); + linelen = strlen(line); + + buf = xrealloc(buf, 1, len + linelen + 1); + memcpy(buf + len, line, linelen); + len += linelen; + buf[len++] = '\n'; + + free(line); + } } limit = options_get_number(&global_options, "buffer-limit"); -- 1.8.0.2 Regards, -- Raghavendra Prabhu GPG Id : 0xD72BE977 Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977 www: wnohang.net pgpR73qR7AGuU.pgp Description: PGP signature -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122412___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Re: [PATCHv2 5/6] Allow '$' and '^' in select-window index.
Hi, * On Mon, Dec 24, 2012 at 12:38:59PM +, Nicholas Marriott wrote: Applied, with man page bits :-). On Sat, Dec 15, 2012 at 05:32:20AM +0530, Raghavendra D Prabhu wrote: This allows one to select the last window (not last-window but window with highest index), so one can bind it to 'select-window -t:$' to jump to the end window, and similary bind to 'select-window -t:^' to jump to the first window (first determined by base-index). Signed-off-by: Raghavendra D Prabhu diff --git a/cmd.c b/cmd.c index 4a17ddc..0077555 100644 --- a/cmd.c +++ b/cmd.c @@ -850,6 +850,10 @@ cmd_find_window(struct cmd_ctx *ctx, const char *arg, struct session **sp) wl = s->curw; else if (winptr[0] == '!' && winptr[1] == '\0') wl = TAILQ_FIRST(&s->lastw); + else if (winptr[0] == '^' && winptr[1] == '\0') + wl = RB_MIN(winlinks, &s->windows); + else if (winptr[0] == '$' && winptr[1] == '\0') + wl = RB_MAX(winlinks, &s->windows); else if (winptr[0] == '+' || winptr[0] == '-') wl = cmd_find_window_offset(winptr, s, &ambiguous); else -- 1.8.0.2 -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users Thank you. (and for others applied) :) Regards, -- Raghavendra Prabhu GPG Id : 0xD72BE977 Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977 www: wnohang.net pgpXCADTarPRJ.pgp Description: PGP signature -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122412___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCHv3 37/42] Add a simpler option to capture the entire pane
Adds a '-h' option to capture the entire pane without providing the appropriate co-ordinates. Signed-off-by: Raghavendra D Prabhu diff --git a/cmd-capture-pane.c b/cmd-capture-pane.c index a94c717..b193748 100644 --- a/cmd-capture-pane.c +++ b/cmd-capture-pane.c @@ -31,8 +31,8 @@ enum cmd_retvalcmd_capture_pane_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_capture_pane_entry = { "capture-pane", "capturep", - "b:E:S:t:", 0, 0, - "[-b buffer-index] [-E end-line] [-S start-line] [-t target-pane]", + "b:E:S:t:h", 0, 0, + "[-b buffer-index] [-E end-line] [-S start-line] [-t target-pane] [-h ]", 0, NULL, NULL, @@ -59,27 +59,32 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_ctx *ctx) buf = NULL; len = 0; - n = args_strtonum(args, 'S', INT_MIN, SHRT_MAX, &cause); - if (cause != NULL) { - top = gd->hsize; - free(cause); - } else if (n < 0 && (u_int) -n > gd->hsize) + if (args_has(args, 'h')) { top = 0; - else - top = gd->hsize + n; - if (top > gd->hsize + gd->sy - 1) - top = gd->hsize + gd->sy - 1; - - n = args_strtonum(args, 'E', INT_MIN, SHRT_MAX, &cause); - if (cause != NULL) { - bottom = gd->hsize + gd->sy - 1; - free(cause); - } else if (n < 0 && (u_int) -n > gd->hsize) - bottom = 0; - else - bottom = gd->hsize + n; - if (bottom > gd->hsize + gd->sy - 1) bottom = gd->hsize + gd->sy - 1; + } else { + n = args_strtonum(args, 'S', INT_MIN, SHRT_MAX, &cause); + if (cause != NULL) { + top = gd->hsize; + free(cause); + } else if (n < 0 && (u_int) -n > gd->hsize) + top = 0; + else + top = gd->hsize + n; + if (top > gd->hsize + gd->sy - 1) + top = gd->hsize + gd->sy - 1; + + n = args_strtonum(args, 'E', INT_MIN, SHRT_MAX, &cause); + if (cause != NULL) { + bottom = gd->hsize + gd->sy - 1; + free(cause); + } else if (n < 0 && (u_int) -n > gd->hsize) + bottom = 0; + else + bottom = gd->hsize + n; + if (bottom > gd->hsize + gd->sy - 1) + bottom = gd->hsize + gd->sy - 1; + } if (bottom < top) { tmp = bottom; -- 1.8.1 -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122412 ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users