On 2012/04/22 06:24, Nicholas Marriott wrote: > Applied, thanks! > You're welcome. BTW, I came to fix this bug because I was looking for a way to keep the tmux buffer 0 synchronized with the X clipboard with a binding like this
bind [ copy-mode \; run "tmux show-buffer | xclip -i -selection clipboard" This does not work because copy-mode "returns" immediately. I thought of these other approaches but I'd like to get your opinion on the matter: 1) add command sequences and a 'run-shell' to copy mode and then rebind what leads to 'copy-selection' 2) add a "synchronous" copy-mode option. 3) add explicit x clipboard handling to tmux like for example vim has. I'm already aware of approaches like this https://wiki.archlinux.org/index.php/Tmux#ICCCM_Selection_Integration Thanks, -Benjamin > > On Fri, Apr 20, 2012 at 10:37:03AM -0400, Benjamin Poirier wrote: > > Changes cmd_print to return an offset that does not include the trailing > > '\0' when the command has no arguments. > > > > --- > > > > One effect of this is that it allows bind-key to work with command > > sequences that contain commands with no arguments. For example, the > > following bind for R does not work without this patch: > > bind R send-prefix \; display-message "done 1" > > bind S send-prefix -2 \; display-message "done 2" > > > > Index: cmd.c > > =================================================================== > > --- cmd.c (revision 2775) > > +++ cmd.c (working copy) > > @@ -303,11 +303,10 @@ cmd_print(struct cmd *cmd, char *buf, size_t len) > > if (off < len) { > > used = args_print(cmd->args, buf + off, len - off); > > if (used == 0) > > - buf[off - 1] = '\0'; > > - else { > > + off--; > > + else > > off += used; > > - buf[off] = '\0'; > > - } > > + buf[off] = '\0'; > > } > > return (off); > > } ------------------------------------------------------------------------------ For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2 _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users