[tmux:feature-requests] #111 Add `session-base-index` configuration for use in `choose-session` dialog
--- ** [feature-requests:#111] Add `session-base-index` configuration for use in `choose-session` dialog** **Status:** open **Created:** Wed Dec 19, 2012 06:43 PM UTC by Ben **Last Updated:** Wed Dec 19, 2012 06:43 PM UTC **Owner:** nobody It would be useful to configure `choose-session` to present: (1) sessionA ... (2) sessionB ... (3) sessionC ... Instead of: (0) sessionA ... (1) sessionB ... (2) sessionC ... Simply for spatial association with standard keyboards. --- Sent from sourceforge.net because you indicated interest in <https://sourceforge.net/p/tmux/feature-requests/111/> To unsubscribe from further messages, please visit <https://sourceforge.net/auth/prefs/>-- 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
[PATCH] Usage string fixes
Hi, Attached are two patches to fix the usage information for the join-pane and paste-buffer usage strings. There's also a patch to remove a trailing space in the CHANGES file if it's important. --Ben Index: cmd-join-pane.c === RCS file: /cvsroot/tmux/tmux/cmd-join-pane.c,v retrieving revision 1.4 diff -U5 -r1.4 cmd-join-pane.c --- cmd-join-pane.c 9 Apr 2010 07:09:37 - 1.4 +++ cmd-join-pane.c 1 Aug 2010 03:06:44 - @@ -42,11 +42,11 @@ int size; }; const struct cmd_entry cmd_join_pane_entry = { "join-pane", "joinp", - "[-dhv] [-p percentage|-l size] [-s src-pane] [-t dst-pane] [command]", + "[-dhv] [-p percentage|-l size] [-s src-pane] [-t dst-pane]", 0, "", cmd_join_pane_init, cmd_join_pane_parse, cmd_join_pane_exec, cmd_join_pane_free, Index: CHANGES === RCS file: /cvsroot/tmux/tmux/CHANGES,v retrieving revision 1.303 diff -U5 -r1.303 CHANGES --- CHANGES 18 Jul 2010 13:40:59 - 1.303 +++ CHANGES 1 Aug 2010 03:30:11 - @@ -10,11 +10,11 @@ windows up if necessary. * Merge more mode into copy mode. * Run job commands explicitly in the global environment (which can be modified with setenv -g), rather than with the environment tmux started with. * Use the machine's hostname as the default title, instead of an empty string. -* Prevent double free if the window option remain-on-exit is set. +* Prevent double free if the window option remain-on-exit is set. * Key string conversions rewritten. * Mark zombie windows as dead in the choose-window list. * Tiled layout added. * Signal handling reworked. * Reset SIGCHLD after fork to fix problems with some shells. Index: cmd-paste-buffer.c === RCS file: /cvsroot/tmux/tmux/cmd-paste-buffer.c,v retrieving revision 1.28 diff -U5 -r1.28 cmd-paste-buffer.c --- cmd-paste-buffer.c 6 Jun 2010 00:03:02 - 1.28 +++ cmd-paste-buffer.c 1 Aug 2010 03:30:29 - @@ -43,11 +43,11 @@ void cmd_paste_buffer_free(struct cmd *); size_t cmd_paste_buffer_print(struct cmd *, char *, size_t); const struct cmd_entry cmd_paste_buffer_entry = { "paste-buffer", "pasteb", - "[-dr] [-s separator] [-b buffer-index] [-t target-window]", + "[-dr] [-s separator] [-b buffer-index] [-t target-pane]", 0, "", cmd_paste_buffer_init, cmd_paste_buffer_parse, cmd_paste_buffer_exec, cmd_paste_buffer_free, pgp8c1tPtWon2.pgp Description: PGP signature -- The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Environment with new windows
Hi, I've been using tmux for a while now and have attached to a session via ssh and then detached. When I go back to the machine with the original session, any new windows have the environment of the ssh session where the attach happens (i.e., new panes inherit the environment of the last `tmux attach` command). I was wondering whether it'd be possible to have, when a pane is created directly (or, rather, unambiguously) by a client, inherit its environment rather than the last client (if the pane is created via a command or some other source, using the last client is fine). Also, since panes and such can move around, tracking a specific pane to interact with via scripts and such can be hard. Would it be possible to have tmux inject a TMUX_PANE_ID into a pane's environment that is static and unique for the life of the pane so that panes can always be reached? Maybe using '%' as an ID identifier in target commands would be possible. Commands to query for the current pane with focus and get back its address and ID would also make sense. This problem arises in screen.vim[1] which cannot reliably track a tmux pane to interact with a specific one. --Ben [1]https://github.com/ervandew/screen pgppobsEevgBR.pgp Description: PGP signature -- Centralized Desktop Delivery: Dell and VMware Reference Architecture Simplifying enterprise desktop deployment and management using Dell EqualLogic storage and VMware View: A highly scalable, end-to-end client virtualization framework. Read more! http://p.sf.net/sfu/dell-eql-dev2dev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Window updates stop until moved
Nicholas Riley wrote: > Hi, > > I have been attempting to switch to tmux but keep running into a problem > where a window doesn't update. > >>From time to time, when I type into a window, only the cursor position > updates; the window contents don't. I can unfreeze the window by moving > it either to another position in the session or to a different session. I've seen this with the aggressive-resize option on and only one client attached. --Ben -- Centralized Desktop Delivery: Dell and VMware Reference Architecture Simplifying enterprise desktop deployment and management using Dell EqualLogic storage and VMware View: A highly scalable, end-to-end client virtualization framework. Read more! http://p.sf.net/sfu/dell-eql-dev2dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Environment with new windows
On Wed, Nov 17, 2010 at 07:40:37PM +, Nicholas Marriott wrote: > No? I tried it and I had other issues (tmux stopped working but it wasn't reliably reproducible) on HEAD. I'll try applying it to Fedora's packages and using those. I'll also see if I can get verbose output with HEAD. --Ben pgpD2hqwuTo1g.pgp Description: PGP signature -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today http://p.sf.net/sfu/msIE9-sfdev2dev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: segfault
Nicholas Marriott wrote: > Pretty sure this is use-after-free, which points to w->last still not > being set properly somewhere. > > Can't reproduce on OpenBSD though and its malloc() is much more > rigorous has much better error checking... The MALLOC_CHECK_ and MALLOC_PERTERB_ variables make malloc stricter. Not sure if OpenBSD's malloc does anything like that by default, but those can cause crashes on bad pointer manipulation. --Ben -- 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: bind-key question
Steve mailinglists wrote: >> Try eg: >> >> set -g terminal-overrides "xterm*:kLFT4=\eO10C:kRIT4=\eO10D" >> > > Thank you that worked for me. This now leaves no reason preventing my switch > to tmux. I love the panes. > Is there anywhere the kLFT4 , kRIT4 mappings are documented? Probably within the bowels of the specs for terminals of yore. To get the control sequences, I use C-v in Insert mode to make the next sequence "verbatim" and that's what the key sends the terminal. Swap the '^[' for '\e' if it appears. > in case I want > to map other keys to functions. I'm already thinking about key combos to > switch panes... I've found that C-s works well if you have C-a as your prefix. --Ben -- 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: Hostname/Command for Window Name
mbm329 wrote: > Hello list, > > I'm trying to transition from GNU Screen to tmux. I like to have my > windows named as the host they are logged into. That is, until I run > a command. Then I like to have it named for the command I'm running. > > In GNU Screen, I accomplished this via the PS1 environment variable. > (some shells in various OSes do not support PROMPT_COMMAND) > > In Linux: > export PS1="\[\033]0;${USER}@${HOSTNAME}\007\]" ##display user@host > in titlebar or "%h" screen string escape > export PS1=${PS1}'\[\033k\033\\\]' ##display running command for > window name in screen's caption line (empty the current name) > export PS1=${PS1}'\[\033k'${HOSTNAME}'\033\\\]' ##show hostname for > window name on screen's caption line when idle > export PS1='<\u@\h:\w>\n'${PS1}'\$ ' > > I place this code in my .bashrc or .profile of each host I ssh into. > It works great in screen. > > When I try this in tmux, it sets the window name (#W) to the hostname > of the system i'm logged into great, but it fails to set it to a > running command (example: top, sar, etc...) > > I believe this is due to the fact that I tell screen what a prompt > looks like via this config: > shelltitle "$ |idle" > > I'm not quite sure how to accomplish this with tmux. I have tried > setw -g automatic-rename on, but from what I've read, after the first > rename (my PS1 being set), it disables this feature for the window. > > Can anyone provide any ideas or solutions that will acknowledge the > escape sequence I'm using for setting the window, yet override it when > a command is run? Perhaps there is a config directive I'm > overlooking. Perhaps there's something even easier and cleaner than > setting PS1 on every host; that would be nice. I use the following setting: set-window-option -g window-status-format '#I#F:#T-#W' which looks something like: 1#:-python by default. When ssh'ing I've seen it become: 1#:user@host-bash I've also seen that tmux is much better at grabbing the process name than screen (ENVVAR=value cmd is 'ENVVAR=value' in screen and 'cmd' in tmux) but it doesn't get things that run under interpreters that well (offlineimap is 'python', for instance). Don't have any machines to ssh into at the moment however to verify the auto-hosting right now. I also have the following function in my zshrc: tmux_title () { if [ -n "$TMUX" ]; then printf "\033]2;$1\033\\" fi } # Initialize to nothing if [[ -z "$VIMRUNTIME" ]]; then tmux_title "" fi To manually name shells and to clear it on new (local) shells that are not from vim (:sh). Hope this helps. --Ben -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. 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: Hostname/Command for Window Name
On Thu, Jan 13, 2011 at 12:46:55PM -0500, mbm329 wrote: > Thanks for the reply. I see what you mean, but I'm not quite sure > this carries over to another server. Indeed. I remember it from my "su -" binding which sets the title to the hostname. > When I SSH to another host, without any of the aforementioned PS1 > setting, I just see my window name set to "ssh". So far as I can > tell, in order to set the window name to the hostname, I need to send > an escape sequence to the terminal, from that host in particular, so > it will recognize what it should rename the window to (\033kVALUE\033, > as you mentioned). That is what I'm doing by setting the PS1 > variable. See below for a possible solution. > As for setting the window name to the command, I would tell screen > what a prompt looked like with the "shelltitle" config directive, and > it would extrapolate the command. You made a good point that screen > was too dumb to realize if the command was actually the _command_ and > not some environment variable being set, terminal trash, or, in HPUX's > case, just part of a really long commandline. One of the reasons I switched in the beginning. > From what I can tell, this may be outside the scope of tmux and > perhaps needs to be something better suited for the local shell of the > host I'm SSHing into. There, the shell, can set that escape sequence > to be whatever it deemed necessary and have the logic to strip out > things like environment variables, interpreters, or other garbage. With tmux_title, the title is static until it is changed again (centerim does it itself if screen support is turned on; haven't seen any other apps that do this) which is why I have sub-vim shells not set it to blank. Because of this, it should be possible to just output the escape sequence in the default shell's configuration file if an SSH session is detected to set the user@host and it would stick. Just need to use #T and #W in the status format string. --Ben -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. 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: Is there some way to send an escape code to the terminal from?inside tmux?
Nicholas Marriott wrote: > Does rxvt support these sequences? I don't think screen does. Probably > best only to check for xterm. I have code in my zsh configuration to set the cursor color based on whether it's in viins or vicmd mode. Of the terminals I'm like to encounter on machines I use day-to-day, only tmux doesn't support cursor color changes. Logic to set the commands below. --Ben _zle_ins="" _zle_cmd="" () { local _zle_ins_color local _zle_cmd_color _zle_ins_color="white" _zle_cmd_color="magenta" if [ "$TERM" = "rxvt-unicode" ] || [ "$TERM" = "rxvt-256color" ] || [ "$TERM" = "xterm" ] || [ "$TERM" = "xterm-256color" ]; then _zle_ins="\033]12;$_zle_ins_color\007" _zle_cmd="\033]12;$_zle_cmd_color\007" elif [ "$TERM" = "screen" ] || [ "$TERM" = "screen-256color" ] || [ "$TERM" = "screen.linux" ]; then if [ -z "$TMUX" ]; then _zle_ins="\033P\033]12;$_zle_ins_color\007\033\\" _zle_cmd="\033P\033]12;$_zle_cmd_color\007\033\\" fi fi } zle-keymap-select () { if [ $KEYMAP = vicmd ]; then echo -ne $_zle_cmd else echo -ne $_zle_ins fi } zle -N zle-keymap-select zle-line-init () { echo -ne $_zle_ins } zle -N zle-line-init -- Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: 256 color support in status line?
Joshua Keroes wrote: > I'd like to use some of the 256 available colors in my status line. What's > the magical incantation to get at say, 30/30/30, 236, a dark gray? > > I searched the manpage and archives but didn't see anything obvious, mostly > there were references to using those colors inside panes and windows. Use "colour236". --Ben -- 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: Environment with new windows
On Sat, Dec 11, 2010 at 03:08:30PM +, Nicholas Marriott wrote: > On Wed, Nov 17, 2010 at 03:41:03PM -0500, Ben Boeckel wrote: > > On Wed, Nov 17, 2010 at 07:40:37PM +, Nicholas Marriott wrote: > > > No? > > > > I tried it and I had other issues (tmux stopped working but it wasn't > > reliably reproducible) on HEAD. I'll try applying it to Fedora's > > packages and using those. I'll also see if I can get verbose output with > > HEAD. > > > > --Ben > > Any joy? I can't seem to make it go wrong in light testing. Sorry for the delay, but I've been testing it lately on top of git master and caused a crash when using swap-pane. I went through the history and matched the pane ID code into features that have been added since then. Description of attached patches: 0001-Add-support-for-pane-ID.patch The original patch rebased onto master (568c723cf33426c1f7fe9419966cf111792f71fb). 0002-Only-store-the-session-back-if-non-NULL.patch Fixes the crash with swap-panes. The cmd_find_pane function is called with a NULL session in this case. 0003-Print-the-pane-ID-when-listing-panes.patch Add the ID to the output when listing panes. 0004-Add-list-session-panes-command.patch 0005-Add-list-server-panes-command.patch These two add commands to list panes with different scopes. Maybe a list-server-windows would be in order as well? 0006-Fix-list-panes-documentation-to-match-the-rest.patch Minor fix to the manpage for list-panes to match the rest of the documentation. 0007-Remove-pane-id-from-TODO-list.patch Mark the pane ID feature off the TODO list. 0008-Add-I-flag-to-new-window-and-split-window.patch Add a -I flag to new-window and split-window commands (similar to -P) to print the ID of the new window. --Ben pgp5J1aOtTjMA.pgp Description: PGP signature -- 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: Environment with new windows
On Sat, Mar 26, 2011 at 06:39:12PM -0400, Ben Boeckel wrote: > 0001-Add-support-for-pane-ID.patch > > The original patch rebased onto master > (568c723cf33426c1f7fe9419966cf111792f71fb). > > 0002-Only-store-the-session-back-if-non-NULL.patch > > Fixes the crash with swap-panes. The cmd_find_pane function is > called with a NULL session in this case. > > 0003-Print-the-pane-ID-when-listing-panes.patch > > Add the ID to the output when listing panes. > > 0004-Add-list-session-panes-command.patch > 0005-Add-list-server-panes-command.patch > > These two add commands to list panes with different scopes. Maybe a > list-server-windows would be in order as well? > > 0006-Fix-list-panes-documentation-to-match-the-rest.patch > > Minor fix to the manpage for list-panes to match the rest of the > documentation. > > 0007-Remove-pane-id-from-TODO-list.patch > > Mark the pane ID feature off the TODO list. > > 0008-Add-I-flag-to-new-window-and-split-window.patch > > Add a -I flag to new-window and split-window commands (similar to > -P) to print the ID of the new window. And I forget to attach them... --Ben From 4c731f2854e6854cd72c39d9765a5b5969f555bb Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 6 Mar 2011 05:25:09 -0500 Subject: [PATCH 1/8] Add support for pane ID --- cmd.c| 97 +++--- server.c |1 + tmux.h |8 + window.c | 31 +++- 4 files changed, 125 insertions(+), 12 deletions(-) diff --git a/cmd.c b/cmd.c index d5f6374..20dd70c 100644 --- a/cmd.c +++ b/cmd.c @@ -117,9 +117,12 @@ struct client *cmd_lookup_client(const char *); struct session *cmd_lookup_session(const char *, int *); struct winlink *cmd_lookup_window(struct session *, const char *, int *); int cmd_lookup_index(struct session *, const char *, int *); +struct window_pane *cmd_lookup_paneid(const char *); +struct session *cmd_pane_session(struct cmd_ctx *, +struct window_pane *, struct winlink **); struct winlink *cmd_find_window_offset(const char *, struct session *, int *); int cmd_find_index_offset(const char *, struct session *, int *); -struct window_pane *cmd_find_pane_offset(const char *, struct winlink *); +struct window_pane *cmd_find_pane_offset(const char *, struct winlink *); int cmd_pack_argv(int argc, char **argv, char *buf, size_t len) @@ -638,21 +641,78 @@ cmd_lookup_index(struct session *s, const char *name, int *ambiguous) return (-1); } +/* + * Lookup pane id. An initial % means a pane id. sp must already point to the + * current session. + */ +struct window_pane * +cmd_lookup_paneid(const char *arg) +{ + const char *errstr; + u_intpaneid; + + if (*arg != '%') + return (NULL); + + paneid = strtonum(arg + 1, 0, UINT_MAX, &errstr); + if (errstr != NULL) + return (NULL); + return (window_pane_find_by_id(paneid)); +} + +/* Find session and winlink for pane. */ +struct session * +cmd_pane_session(struct cmd_ctx *ctx, struct window_pane *wp, +struct winlink **wlp) +{ + struct session *s; + struct sessionslist ss; + struct winlink *wl; + + /* If this pane is in the current session, return that winlink. */ + s = cmd_current_session(ctx); + if (s != NULL) { + wl = winlink_find_by_window(&s->windows, wp->window); + if (wl != NULL) { + if (wlp != NULL) + *wlp = wl; + return (s); + } + } + + /* Otherwise choose from all sessions with this pane. */ + ARRAY_INIT(&ss); + RB_FOREACH(s, sessions, &sessions) { + if (winlink_find_by_window(&s->windows, wp->window) != NULL) + ARRAY_ADD(&ss, s); + } + s = cmd_choose_session_list(&ss); + ARRAY_FREE(&ss); + if (wlp != NULL) + *wlp = winlink_find_by_window(&s->windows, wp->window); + return (s); +} + /* Find the target session or report an error and return NULL. */ struct session * cmd_find_session(struct cmd_ctx *ctx, const char *arg) { - struct session *s; - struct client *c; - char*tmparg; - size_t arglen; - int ambiguous; + struct session *s; + struct window_pane *wp; + struct client *c; + char*tmparg; + size_t arglen; + int ambiguous; /* A NULL argument means the current session. */ if (arg == NULL) return (cmd
Re: Environment with new windows
On Sun, Mar 27, 2011 at 09:53:35PM +0100, Nicholas Marriott wrote: > > > 0004-Add-list-session-panes-command.patch > > > 0005-Add-list-server-panes-command.patch > > > > > > These two add commands to list panes with different scopes. Maybe a > > > list-server-windows would be in order as well? > > Hmm. I'm not at all convinced we need any new commands. I wonder if this > stuff could be hooked into existing ones as new flags. New patches attached (-a and -s flags for server and session listing, respectively, for list-panes as well as -a for list-windows). 0005-Add-a-and-s-flags-to-list-panes.patch 0006-Add-a-flag-to-list-windows.patch > > > 0006-Fix-list-panes-documentation-to-match-the-rest.patch > > > > > > Minor fix to the manpage for list-panes to match the rest of the > > > documentation. > > > > > I think we don't need to do this, Xc/Xo are only needed in mdoc if you > hit the limit of the number of parameters to It. Removed here. > > > 0008-Add-I-flag-to-new-window-and-split-window.patch > > > > > > Add a -I flag to new-window and split-window commands (similar to > > > -P) to print the ID of the new window. Feedback? 0001 through 0003 are the same as before and 0004 is the 0008 from last time. --Ben From 1ca8b937415788318a45dcf4671cd83b67f3c54d Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 28 Mar 2011 17:46:29 -0400 Subject: [PATCH 5/6] Add -a and -s flags to list-panes The -a flag is used to list all panes on the server and the -s flag is used to list all panes in a session. --- cmd-list-panes.c | 58 + tmux.1 | 20 +++-- 2 files changed, 66 insertions(+), 12 deletions(-) diff --git a/cmd-list-panes.c b/cmd-list-panes.c index c8aa7e9..8670168 100644 --- a/cmd-list-panes.c +++ b/cmd-list-panes.c @@ -30,28 +30,70 @@ int cmd_list_panes_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_list_panes_entry = { "list-panes", "lsp", - "t:", 0, 0, - CMD_TARGET_WINDOW_USAGE, + "t:as", 0, 0, + "[-as] [-t target]", 0, NULL, NULL, cmd_list_panes_exec }; +static void cmd_list_panes_on_server(struct cmd_ctx* ctx); +static void cmd_list_panes_in_session(struct session* s, struct cmd_ctx* ctx); +static void cmd_list_panes_in_window(struct winlink* wl, struct cmd_ctx* ctx); + int cmd_list_panes_exec(struct cmd *self, struct cmd_ctx *ctx) { - struct args *args = self->args; - struct winlink *wl; + struct args *args = self->args; + struct session *s; + struct winlink *wl; + + if (args_has(args, 'a')) { + cmd_list_panes_on_server(ctx); + } else if (args_has(args, 's')) { + if ((s = cmd_find_session(ctx, args_get(args, 't'))) == NULL) + return (-1); + + cmd_list_panes_in_session(s, ctx); + } else { + if ((wl = cmd_find_window(ctx, args_get(args, 't'), NULL)) == NULL) + return (-1); + + cmd_list_panes_in_window(wl, ctx); + } + + return (0); +} + +void +cmd_list_panes_on_server(struct cmd_ctx* ctx) +{ + struct session *s; + + RB_FOREACH(s, sessions, &sessions) { + cmd_list_panes_in_session(s, ctx); + } +} + +void +cmd_list_panes_in_session(struct session* s, struct cmd_ctx* ctx) +{ + struct winlink *wl; + + RB_FOREACH(wl, winlinks, &s->windows) { + cmd_list_panes_in_window(wl, ctx); + } +} + +void cmd_list_panes_in_window(struct winlink* wl, struct cmd_ctx* ctx) +{ struct window_pane *wp; struct grid *gd; struct grid_line*gl; u_inti, n; unsigned long long size; - if ((wl = cmd_find_window(ctx, args_get(args, 't'), NULL)) == NULL) - return (-1); - n = 0; TAILQ_FOREACH(wp, &wl->window->panes, entry) { gd = wp->base.grid; @@ -70,6 +112,4 @@ cmd_list_panes_exec(struct cmd *self, struct cmd_ctx *ctx) wp->fd == -1 ? " (dead)" : ""); n++; } - - return (0); } diff --git a/tmux.1 b/tmux.1 index 4b21282..67e877d 100644 --- a/tmux.1 +++ b/tmux.1 @@ -1099,10 +1099,24 @@ exists, it is killed, otherwise an error is generated. If .Fl d is given, the newly linked window is not selected. -.It Ic list-panes Op Fl t Ar target-window +.It Xo Ic list-panes +.Op Fl as +.Op Fl t Ar target +.Xc .D1 (alias: Ic lsp ) -List the panes in the current window or in -.Ar target-wind
Re: Environment with new windows
On Tue, Mar 29, 2011 at 12:39:15AM +0100, Nicholas Marriott wrote: > Thinking about this I wonder if it is better to do this and add a > target-pane to display-message and #D for pane id, then you can do eg: > > tmux display -p -P `tmux neww -P` '#D' > > Not sure I like -P though, think I would prefer to change -t to -c and > use -t but I don't know if people use it already. Perhaps it is unlikely. -t and -c sound better to me as well. --Ben pgpY9oTQGsmWe.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: Italics in tmux
Nicholas Marriott wrote: > Thanks, applied. I made some minor tweaks and changed ~/.screen.conf to > ~/.tmux.conf ;-). So it seems as though this patch has screwed up less somehow. Now I get no reverse video on the status line or search results. Can anyone else confirm? --Ben -- 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
Tiago Resende wrote: > I'm gonna take a guess here. I think urxvt is reporting to support sitm > when it actually doesn't, then screen-256color does its switch between > sitm and smso, then less requests standout but gets italics instead, > which urxvt simply refuses to render. I just reproduced it with xterm > exporting TERM=rxvt-unicode-256color. Fun. > Can you run > > $ echo '\e[3mitalics\e[m' '\e[7mstandout\e[m' > > in and out of tmux? Both should come out as reverse in tmux , but I'm > guessing italics will come out as regular text (that is, unrendered > italics). If this also happens outside of tmux, then your urxvt really > can't render italics, so if it's repoting \e[3m for sitm in its > terminfo, that would be the actual culprit here. Both do normal "italics" and reverse "standout". > So, could you also attach output of > > $ infocmp $TERM | grep sitm > > ran on urxvt outside of tmux (or just replacing $TERM for what your > urxvt normally uses)? If your urxvt really does not support italics, you > should either get nothing or \e[7m instead. % infocmp rxvt-unicode-256color | grep sitm sgr0=\E[m\E(B, sitm=\E[3m, smacs=\E(0, smam=\E[?7h, --Ben -- 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
Tiago Resende wrote: > I was thinking, urxvt has always (I think) supported italics, so unless > your build was specifically patched to remove it (not disable it during > /configure, because if that was the case, urxvt _would_ render italics > as reverse), maybe you are just missing a font with italics? Indeed. I'm using terminus which doesn't have italics built-in. > urxvt's faq recommends Bitstream Vera; I personally use Dina. You can > use anything that is installed in your system and has italics. > > You can try it with > > $ urxvt -fi "xft:Bitstream Vera Sans Mono:italic:autohint=true" > > for example. Then, echo '\e[3mitalics\e[m' should render italics. To > store it permanentely, add > > urxvt.italicFont: xft:Bitstream Vera Sans Mono:italic:autohint=true > > to ~/.Xdefaults > > Also, could you let us know if this is the case? If so, it might be a > good idea to mention it in the faq. Thanks, this works :) . The FAQ sounds like a good place for it. --Ben -- 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
Peter John Hartman wrote: > On Mon, Apr 18, 2011 at 09:05:21AM -0700, Micah Cowan wrote: >> On 04/18/2011 01:19 AM, LEVAI Daniel wrote: >> > Any chance of getting this fixed? It's a really annoying phenomena. > > +1 here > >> >> 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. > > None of these are really nice options. I use urxvt which is a rather > standard terminal; I want my status interval to be 2 seconds; and I > find copy-mode less efficient when I want to just grab something quick. > > I resort to toggling the status off when I want to cut something, but > this is annoying since most of the time I select something, realize that > the status is still on, watch my selection dissolve in front of my eyes, > and then toggle and reselect. > > Hence, I for one would love to see tmux figure out a way to work with > normal (urxvt at least) terminal selection! I'm using urxvt from Fedora and tmux HEAD, but I've never encountered this issue (I started using tmux around 1.3, but tmux 1.1 on CentOS was also lacking this behavior; urxvt 9.05 if Koji[1] is to be believed). What versions of urxvt are you running? Are you using the daemon/client version or the standalone instance (I have experienced no issues with either)? rxvt-unicode-256color-9.10-3.fc15.x86_64 --Ben [1]http://koji.fedoraproject.org/koji/buildinfo?buildID=110663 -- 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: Display behaviour, clearing, etc.
Robin Lee Powell wrote: > On Wed, May 18, 2011 at 12:06:28PM -0700, Micah Cowan wrote: >> 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. > > Oh. I'm sorry, but I'm really not prepared to completely stop tmux > on that box; all my work is under there. Here's my tmux.conf, then; > if it's really important that I try this with an empty one, let me > know and I'll set up a different machine. It's a copy of a "make it > act like screen" example I found, with minor mods. You can also pass "-S foo" to tmux to start a new server with the socket set to "foo" instead of the default. --Ben -- 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: Newbie: Search history
Pablo S.M. wrote: > I'm trying to configure tmux and i'm having a (for me) big problem > with the PageUp key: normally i use in zsh PageUp and PageDown to > search the history. I have the following in my zshrc: > > bindkey '^[[5~' history-beginning-search-backward > bindkey '^[[6~' history-beginning-search-forward Hi, You might want to look into zkbd to help handle the sequences for different keys that differ between shells. My zsh setup is here[1]. For how I use zkbd, look in zsh/config/00-zkbd.zsh in that directory. Happy to help. --Ben [1]http://git.benboeckel.net/?p=dotfiles.git;a=tree;f=dotfiles/base/shell/zsh -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
PAM support in tmux?
Hi, With systemd-logind, there will be the option to kill all user processes on logout. I was wondering whether a patch to start a PAM session for each tmux server would be accepted. It would be a compile-time option and if wanted, options could also be added. Thanks. --Ben [1]http://0pointer.de/public/systemd-man/systemd-logind.conf.html -- 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks & Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/ ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: PAM support in tmux?
Nicholas Marriott wrote: > Maybe. Can you give a bit more explanation? What is systemd-logind and > why does this option have anything to do with PAM? Why does it need PAM > to kill processes on logout? If applications do nothing, they will be killed on logout. If, instead, the application declares that it holds a session via PAM, it will be left alone (my tests with Rawhide so far indicate that something isn't quite right and isn't happening as setting it doesn't really do much). > I'm not really clear on the use case either. It seems to me that if the > admin wants to kill all processes of a user on logout then tmux > shouldn't be an exception I'll ask the systemd devs about this case. > (or if it is, it should be in the program doing the killing and > configured by the admin, not in tmux). It tracks PAM sessions. I'd imagine this is cleaner than keeping a list of exemptions somewhere. > Or if the user wants to kill processes, why can't they do what they do > now and tmux will keep running as normal since it is stays as a > daemon...? systemd-logind puts a user's session into a cgroup and kills the heirarchy when the user logs out. Without tmux declaring another session, tmux is in the session that gets killed. > PAM is a bit awful so I'm reluctant to let tmux touch it without a > really good reason. The patch is attached (doesn't adversely affect things on F15, trying out the Rawhide box when I get a chance). I'll ask the systemd devs if the patch does what is needed. --Ben diff --git a/trunk/configure.ac b/trunk/configure.ac index ba00a79..fce018b 100644 --- a/trunk/configure.ac +++ b/trunk/configure.ac @@ -56,6 +56,13 @@ AC_ARG_ENABLE( ) AM_CONDITIONAL(IS_STATIC, test "x" = xyes) +# PAM support? +AC_ARG_ENABLE( + pam, + AC_HELP_STRING(--enable-pam, create a PAM session on server startup), + found_pam=$enable_pam +) + # Is this gcc? AM_CONDITIONAL(IS_GCC, test "x$GCC" = xyes) AC_MSG_CHECKING(for gcc that whines about -I) @@ -121,6 +128,18 @@ if test "x$found_curses" = xno; then AC_MSG_ERROR("curses not found") fi +if test "x$enable_pam" = xyes; then +# Look for libpam. +AC_SEARCH_LIBS(pam_start, [pam], found_pam=yes, found_pam=no) +# Look for libpam_misc. +AC_SEARCH_LIBS(misc_conv, [pam_misc], found_pam_misc=yes, found_pam_misc=no) +if test "x$found_pam" = xno || test "x$found_pam_misc" = xno; then + AC_MSG_ERROR("PAM not found") +else + AC_DEFINE(ENABLE_PAM) +fi +fi + # Look for networking libraries. AC_SEARCH_LIBS(b64_ntop, resolv) AC_SEARCH_LIBS(__b64_ntop, resolv) diff --git a/trunk/server.c b/trunk/server.c index c442c66..4fc3b9d 100644 --- a/trunk/server.c +++ b/trunk/server.c @@ -16,6 +16,11 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifdef ENABLE_PAM +#include +#include +#endif + #include #include #include @@ -26,6 +31,9 @@ #include #include #include +#ifdef ENABLE_PAM +#include +#endif #include #include #include @@ -52,6 +60,11 @@ struct event server_ev_second; struct paste_stack global_buffers; +#ifdef ENABLE_PAM +pam_handle_t *pam_handle; +int pam_last_status; +#endif + int server_create_socket(void); voidserver_loop(void); int server_should_shutdown(void); @@ -65,6 +78,10 @@ void server_child_stopped(pid_t, int); voidserver_second_callback(int, short, void *); voidserver_lock_server(void); voidserver_lock_sessions(void); +#ifdef ENABLE_PAM +voidserver_pam_init(void); +voidserver_pam_teardown(void); +#endif /* Create server socket. */ int @@ -152,6 +169,9 @@ server_start(void) mode_key_init_trees(); key_bindings_init(); utf8_build(); +#ifdef ENABLE_PAM + server_pam_init(); +#endif start_time = time(NULL); log_debug("socket path %s", socket_path); @@ -199,6 +219,9 @@ server_start(void) set_signals(server_signal_callback); server_loop(); +#ifdef ENABLE_PAM + server_pam_teardown(); +#endif exit(0); } @@ -522,3 +545,63 @@ server_lock_sessions(void) } } } + +#ifdef ENABLE_PAM +/* Start a PAM session */ +void +server_pam_init(void) +{ + struct passwd *passwd_struct; + struct pam_conv conv; + + pam_handle = NULL; + + passwd_struct = getpwuid(geteuid()); + + if (!passwd_struct) { + log_warnx("getpwuid error: %s", strerror(errno)); + return; + } + + conv.conv = misc_conv; + conv.appdata_ptr = NULL; + + pam_last_status = pam_start("tmux", passwd_struct->pw_name, &conv, &pam_handle); + + if (pa
Added pane-base-index option
Hello, I was wishing I had the pane-base-index option this morning, and after learning that it wasn't there (although it was on the TODO list) I just added it myself. It's a very tiny change. At first I thought I'd just use my version, but I think it's about time I start contributing to the open-source world. I don't know how/where to start though. :P Is there any place i should commit or send my changes / or any documentation I should read on how to contribute? What about any formal testing? I tried to send a Sourceforge message to the project admin (ncim) using the link on the Develop tab, but Sourceforge keeps throwing me an error. Thanks, Peregrinati -- uberSVN's rich system and user administration capabilities and model configuration take the hassle out of deploying and managing Subversion and the tools developers use with it. Learn more about uberSVN and get a free download at: http://p.sf.net/sfu/wandisco-dev2dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Implement pane_index format string
Hi, The -F flag is great! I found out that pane_index was not implemented however. The first patch adds pane_index to the format_tree. The second patch fixes list-panes to use it rather than the 'line' format it implements itself. The third patch fixes window_pane_index to return (u_int)(-1) if the pane is not in the window given and logs a message about it. The third patch made me wonder whether it's unnecessary to pass the window when getting a pane index since a pane knows the window it is a member of anyways. A fourth patch changes it to do this. I've not hit any issues yet, but I'll use it for a week or so to make sure. --Ben From 7c76a713a897c03482fa18c52d140a8835a3a30e Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 19 Oct 2011 17:39:16 -0400 Subject: [PATCH 1/4] Implement the pane_index format string --- trunk/format.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/trunk/format.c b/trunk/format.c index 0aad938..780e224 100644 --- a/trunk/format.c +++ b/trunk/format.c @@ -325,6 +325,7 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp) struct grid_line*gl; unsigned long long size; u_inti; + u_intidx; size = 0; for (i = 0; i < gd->hsize; i++) { @@ -334,8 +335,11 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp) } size += gd->hsize * sizeof *gd->linedata; + idx = window_pane_index(wp->window, wp); + format_add(ft, "pane_width", "%u", wp->sx); format_add(ft, "pane_height", "%u", wp->sy); + format_add(ft, "pane_index", "%u", idx); format_add(ft, "pane_title", "%s", wp->base.title); format_add(ft, "history_size", "%u", gd->hsize); format_add(ft, "history_limit", "%u", gd->hlimit); -- 1.7.6.4 From b495fb3ec384c5be1ca3429339fb2fefeec1ac5c Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 19 Oct 2011 17:39:31 -0400 Subject: [PATCH 2/4] Use the pane_index format string --- trunk/cmd-list-panes.c |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/trunk/cmd-list-panes.c b/trunk/cmd-list-panes.c index 723c703..f46c3c5 100644 --- a/trunk/cmd-list-panes.c +++ b/trunk/cmd-list-panes.c @@ -102,21 +102,21 @@ cmd_list_panes_window(struct cmd *self, if (template == NULL) { switch (type) { case 0: - template = "#{line}: " + template = "#{pane_index}: " "[#{pane_width}x#{pane_height}] [history " "#{history_size}/#{history_limit}, " "#{history_bytes} bytes] #{pane_id}" "#{?pane_active, (active),}#{?pane_dead, (dead),}"; break; case 1: - template = "#{window_index}.#{line}: " + template = "#{window_index}.#{pane_index}: " "[#{pane_width}x#{pane_height}] [history " "#{history_size}/#{history_limit}, " "#{history_bytes} bytes] #{pane_id}" "#{?pane_active, (active),}#{?pane_dead, (dead),}"; break; case 2: - template = "#{session_name}:#{window_index}.#{line}: " + template = "#{session_name}:#{window_index}.#{pane_index}: " "[#{pane_width}x#{pane_height}] [history " "#{history_size}/#{history_limit}, " "#{history_bytes} bytes] #{pane_id}" @@ -128,7 +128,6 @@ cmd_list_panes_window(struct cmd *self, n = 0; TAILQ_FOREACH(wp, &wl->window->panes, entry) { ft = format_create(); - format_add(ft, "line", "%u", n); format_session(ft, s); format_winlink(ft, s, wl); format_window_pane(ft, wp); -- 1.7.6.4 From 95570f01e11670a0f2b70c71b95defa0c17df432 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 19 Oct 2011 17:43:32 -0400 Subject: [PATCH 3/4] Return '-1' for invalid pane index queries If we're going to return a bogus index anyways (one past the max index in the window), at make it a consistent and obviously invalid index instead of a plausible one. Also log a message. --- trunk/window.c | 13 - 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/trunk/window.c b/trunk/window.c index 8b
Re: Implement pane_index format string
On Thu, Oct 20, 2011 at 07:59:42 +0100, Nicholas Marriott wrote: > Seems fine, but instead of returning (u_int)-1 can we change it to work > like window_index. Seems reasonable. Patch attached (applies on top of previous patches). --Ben From 75cdc56b9bbe2b5b25fd9374d73006325b04a345 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 20 Oct 2011 12:03:55 -0400 Subject: [PATCH 5/5] Change window_pane_index to be like window_index --- trunk/cmd-respawn-pane.c |5 - trunk/cmd-split-window.c |3 ++- trunk/format.c |7 +-- trunk/screen-redraw.c|5 +++-- trunk/status.c |5 - trunk/tmux.h |2 +- trunk/window.c | 21 ++--- 7 files changed, 25 insertions(+), 23 deletions(-) diff --git a/trunk/cmd-respawn-pane.c b/trunk/cmd-respawn-pane.c index 232ef72..d4d67d5 100644 --- a/trunk/cmd-respawn-pane.c +++ b/trunk/cmd-respawn-pane.c @@ -50,14 +50,17 @@ cmd_respawn_pane_exec(struct cmd *self, struct cmd_ctx *ctx) struct environ env; const char *cmd; char*cause; + u_intidx; if ((wl = cmd_find_pane(ctx, args_get(args, 't'), &s, &wp)) == NULL) return (-1); w = wl->window; if (!args_has(self->args, 'k') && wp->fd != -1) { + if (window_pane_index(wp, &idx) != 0) + fatalx("index not found"); ctx->error(ctx, "pane still active: %s:%u.%u", - s->name, wl->idx, window_pane_index(wp)); + s->name, wl->idx, idx); return (-1); } diff --git a/trunk/cmd-split-window.c b/trunk/cmd-split-window.c index 22e6113..258c632 100644 --- a/trunk/cmd-split-window.c +++ b/trunk/cmd-split-window.c @@ -139,7 +139,8 @@ cmd_split_window_exec(struct cmd *self, struct cmd_ctx *ctx) environ_free(&env); if (args_has(args, 'P')) { - paneidx = window_pane_index(new_wp); + if (window_pane_index(new_wp, &paneidx) != 0) + fatalx("index not found"); ctx->print(ctx, "%s:%u.%u", s->name, wl->idx, paneidx); } return (0); diff --git a/trunk/format.c b/trunk/format.c index 3acfc3f..0897c95 100644 --- a/trunk/format.c +++ b/trunk/format.c @@ -324,7 +324,7 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp) struct grid *gd = wp->base.grid; struct grid_line*gl; unsigned long long size; - u_inti; + u_inti, idx; size = 0; for (i = 0; i < gd->hsize; i++) { @@ -334,9 +334,12 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp) } size += gd->hsize * sizeof *gd->linedata; + if (window_pane_index(wp, &idx) != 0) + fatalx("index not found"); + format_add(ft, "pane_width", "%u", wp->sx); format_add(ft, "pane_height", "%u", wp->sy); - format_add(ft, "pane_index", "%u", window_pane_index(wp)); + format_add(ft, "pane_index", "%u", idx); format_add(ft, "pane_title", "%s", wp->base.title); format_add(ft, "history_size", "%u", gd->hsize); format_add(ft, "history_limit", "%u", gd->hlimit); diff --git a/trunk/screen-redraw.c b/trunk/screen-redraw.c index 4ff176e..c9e0542 100644 --- a/trunk/screen-redraw.c +++ b/trunk/screen-redraw.c @@ -264,7 +264,7 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp) { struct tty *tty = &c->tty; struct session *s = c->session; - struct options *oo = &s->options; + struct options *oo = &s->options; struct window *w = wp->window; struct grid_cell gc; u_intidx, px, py, i, j, xoff, yoff; @@ -272,7 +272,8 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp) char buf[16], *ptr; size_t len; - idx = window_pane_index(wp); + if (window_pane_index(wp, &idx) != 0) + fatalx("index not found"); len = xsnprintf(buf, sizeof buf, "%u", idx); if (wp->sx < len) diff --git a/trunk/status.c b/trunk/status.c index 6be1b7e..349e724 100644 --- a/trunk/status.c +++ b/trunk/status.c @@ -372,6 +372,7 @@ status_replace1(struct client *c, struct session *s, struct winlink *wl, charch, tmp[256], *ptr, *endptr, *freeptr; size_t ptrle
Implement word motion edit actions
Hi, I also implemented word motion actions for editing at the command prompt. These patches are (or at least should be; a git merge is clean) independent of the pane_index format patches I posted earlier. In order to do this, I added options for clients (currently just word-separators) and the associated commands and documentation for them. This is done in the first patch. The second patch contains updates for commands and options added since the last time it was updated. More of an "since I was there" kind of thing rather than relevant to the feature. The third patch adds the actions and bindings for vi and emacs (which is untested and may be incomplete; I just copied from the emacs copy key table). The next four patches implement the actions: delete-word previous-word next-word-end next-word The final patch removes the TODO item. I've tested it here with success. I don't do much at tmux's command prompt, but I tried to stress test it. --Ben From 2f978366a1e71ee6236647d77b46b2745c9aeaad Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 20 Oct 2011 01:42:19 -0400 Subject: [PATCH 1/8] Add word-separator option to clients This is for the next-word, next-word-end, previous-word, and delete-word commands in edit mode. Currently only a window has word-separators as an option. This commit adds the client option and the related code to get client options available including: - set-client-option command - show-client-option command - word-separators option - documentation for the above - update vim syntax highlighting There are a few incidental whitespace fixes as well. --- trunk/cmd-set-option.c | 25 - trunk/cmd-show-options.c | 28 ++-- trunk/cmd.c |2 + trunk/compat/getopt.c|2 +- trunk/examples/tmux.vim |4 +++ trunk/options-table.c| 10 trunk/server-client.c|2 + trunk/tmux.1 | 52 + trunk/tmux.c |4 +++ trunk/tmux.h |6 + 10 files changed, 124 insertions(+), 11 deletions(-) diff --git a/trunk/cmd-set-option.c b/trunk/cmd-set-option.c index c19f023..cd43546 100644 --- a/trunk/cmd-set-option.c +++ b/trunk/cmd-set-option.c @@ -63,8 +63,18 @@ struct options_entry *cmd_set_option_choice(struct cmd *, struct cmd_ctx *, const struct cmd_entry cmd_set_option_entry = { "set-option", "set", - "agst:uw", 1, 2, - "[-agsuw] [-t target-session|target-window] option [value]", + "acgst:uw", 1, 2, + "[-acgsuw] [-t target-session|target-client|target-window] option [value]", + 0, + NULL, + NULL, + cmd_set_option_exec +}; + +const struct cmd_entry cmd_set_client_option_entry = { + "set-client-option", "setc", + "agt:u", 1, 2, + "[-agu] " CMD_TARGET_CLIENT_USAGE " option [value]", 0, NULL, NULL, @@ -89,6 +99,7 @@ cmd_set_option_find( { static const struct options_table_entry *tables[] = { server_options_table, + client_options_table, window_options_table, session_options_table }; @@ -120,6 +131,7 @@ cmd_set_option_exec(struct cmd *self, struct cmd_ctx *ctx) struct args *args = self->args; const struct options_table_entry*table, *oe; struct session *s; + struct client *cl; struct winlink *wl; struct client *c; struct options *oo; @@ -160,6 +172,15 @@ cmd_set_option_exec(struct cmd *self, struct cmd_ctx *ctx) return (-1); oo = &wl->window->options; } + } else if (table == client_options_table) { + if (args_has(self->args, 'g')) + oo = &global_c_options; + else { + cl = cmd_find_client(ctx, args_get(args, 't')); + if (cl == NULL) + return (-1); + oo = &cl->options; + } } else if (table == session_options_table) { if (args_has(self->args, 'g')) oo = &global_s_options; diff --git a/trunk/cmd-show-options.c b/trunk/cmd-show-options.c index 397b0c9..36e0c33 100644 --- a/trunk/cmd-show-options.c +++ b/trunk/cmd-show-options.c @@ -31,8 +31,8 @@ int cmd_show_options_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_show_options_entry = { "show-options", "show", - "
Re: Implement word motion edit actions
On Thu, Oct 20, 2011 at 12:17:48 -0400, Ben Boeckel wrote: > @@ -64,7 +75,7 @@ cmd_show_options_exec(struct cmd *self, struct cmd_ctx *ctx) > oo = &global_options; > table = server_options_table; > } else if (args_has(self->args, 'w') || > - self->entry == &cmd_show_window_options_entry) { > + self->entry == &cmd_show_window_options_entry) { > table = window_options_table; > if (args_has(self->args, 'g')) > oo = &global_w_options; > @@ -74,6 +85,17 @@ cmd_show_options_exec(struct cmd *self, struct cmd_ctx > *ctx) > return (-1); > oo = &wl->window->options; > } > + } else if (args_has(self->args, 'c') || > + self->entry == &cmd_show_client_options_entry) { > + table = client_options_table; > + if (args_has(self->args, 'g')) > + oo = &global_c_options; > + else { > + cl = cmd_find_client(ctx, args_get(args, 't')); > + if (cl == NULL) > + return (-1); > + oo = &cl->options; > + } > } else { > table = session_options_table; > if (args_has(self->args, 'g')) Whoops on the indentation here. Replacement 0001 patch attached. --Ben From ee9a3162228f330c70f0343b635a2951786b Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 20 Oct 2011 01:42:19 -0400 Subject: [PATCH 1/8] Add word-separator option to clients This is for the next-word, next-word-end, previous-word, and delete-word commands in edit mode. Currently only a window has word-separators as an option. This commit adds the client option and the related code to get client options available including: - set-client-option command - show-client-option command - word-separators option - documentation for the above - update vim syntax highlighting There are a few incidental whitespace fixes as well. --- trunk/cmd-set-option.c | 25 - trunk/cmd-show-options.c | 26 +- trunk/cmd.c |2 + trunk/compat/getopt.c|2 +- trunk/examples/tmux.vim |4 +++ trunk/options-table.c| 10 trunk/server-client.c|2 + trunk/tmux.1 | 52 + trunk/tmux.c |4 +++ trunk/tmux.h |6 + 10 files changed, 123 insertions(+), 10 deletions(-) diff --git a/trunk/cmd-set-option.c b/trunk/cmd-set-option.c index c19f023..cd43546 100644 --- a/trunk/cmd-set-option.c +++ b/trunk/cmd-set-option.c @@ -63,8 +63,18 @@ struct options_entry *cmd_set_option_choice(struct cmd *, struct cmd_ctx *, const struct cmd_entry cmd_set_option_entry = { "set-option", "set", - "agst:uw", 1, 2, - "[-agsuw] [-t target-session|target-window] option [value]", + "acgst:uw", 1, 2, + "[-acgsuw] [-t target-session|target-client|target-window] option [value]", + 0, + NULL, + NULL, + cmd_set_option_exec +}; + +const struct cmd_entry cmd_set_client_option_entry = { + "set-client-option", "setc", + "agt:u", 1, 2, + "[-agu] " CMD_TARGET_CLIENT_USAGE " option [value]", 0, NULL, NULL, @@ -89,6 +99,7 @@ cmd_set_option_find( { static const struct options_table_entry *tables[] = { server_options_table, + client_options_table, window_options_table, session_options_table }; @@ -120,6 +131,7 @@ cmd_set_option_exec(struct cmd *self, struct cmd_ctx *ctx) struct args *args = self->args; const struct options_table_entry*table, *oe; struct session *s; + struct client *cl; struct winlink *wl; struct client *c; struct options *oo; @@ -160,6 +172,15 @@ cmd_set_option_exec(struct cmd *self, struct cmd_ctx *ctx) return (-1); oo = &wl->window->options; } + } else if (table == client_options_table) { + if (args_has(self->args, 'g')) + oo = &global_c_options; + else { + cl = cmd_find_client(ctx, args_get(args, 't')); + if (cl == NULL) +
Re: Implement pane_index format string
And add back the line format string that I deleted. Didn't realize that it wasn't just a hack for pane_index. --Ben From d18fd48cdf53b6affcb3b67a5a89861f0590046f Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 20 Oct 2011 14:30:23 -0400 Subject: [PATCH 6/6] Add line back to the format strings I missed that this was a standard argument, not just being abused to get the pane index instead. --- trunk/cmd-list-panes.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/trunk/cmd-list-panes.c b/trunk/cmd-list-panes.c index f46c3c5..7331abd 100644 --- a/trunk/cmd-list-panes.c +++ b/trunk/cmd-list-panes.c @@ -128,6 +128,7 @@ cmd_list_panes_window(struct cmd *self, n = 0; TAILQ_FOREACH(wp, &wl->window->panes, entry) { ft = format_create(); + format_add(ft, "line", "%u", n); format_session(ft, s); format_winlink(ft, s, wl); format_window_pane(ft, wp); -- 1.7.6.4 pgp34dFPu8NYu.pgp Description: PGP signature -- The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Implement word motion edit actions
On Thu, Oct 20, 2011 at 12:17:48 -0400, Ben Boeckel wrote: > In order to do this, I added options for clients (currently just > word-separators) and the associated commands and documentation for them. > This is done in the first patch. Fixing some whitespace in the man page. --Ben From 60e5e44fd0d256cddc384afb156c65df08e89d20 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 20 Oct 2011 12:25:12 -0400 Subject: [PATCH 9/9] Fix whitespace in the man page --- trunk/tmux.1 |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/trunk/tmux.1 b/trunk/tmux.1 index 7687ceb..923054e 100644 --- a/trunk/tmux.1 +++ b/trunk/tmux.1 @@ -1679,8 +1679,8 @@ The appearance and behaviour of may be modified by changing the value of various options. There are four types of option: .Em server options , -.Em session options, -.Em client options +.Em session options , +.Em client options and .Em window options . .Pp -- 1.7.6.4 pgpYItLabkZnZ.pgp Description: PGP signature -- The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Implement client format strings
Hi, I've also updated list-clients to use format strings and added formatters for client information as well. The first patch adds the formatting code, the second updates list-clients to leverage it. --Ben From 1bf0c319db1bb0a4c8f910097907ac945f44e7a0 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 20 Oct 2011 14:25:25 -0400 Subject: [PATCH 1/2] Add format strings for clients --- trunk/format.c | 36 trunk/tmux.1 | 11 +++ trunk/tmux.h |1 + 3 files changed, 48 insertions(+), 0 deletions(-) diff --git a/trunk/format.c b/trunk/format.c index 0aad938..74df2ab 100644 --- a/trunk/format.c +++ b/trunk/format.c @@ -295,6 +295,42 @@ format_session(struct format_tree *ft, struct session *s) format_add(ft, "session_attached", "%d", 1); } +/* Set default format keys for a client. */ +void +format_client(struct format_tree *ft, struct client *c) +{ + char*tim; + time_t t; + + format_add(ft, "client_cwd", "%s", c->cwd); + format_add(ft, "client_height", "%u", c->tty.sx); + format_add(ft, "client_width", "%u", c->tty.sy); + format_add(ft, "client_tty", "%s", c->tty.path); + format_add(ft, "client_termname", "%s", c->tty.termname); + + t = c->creation_time.tv_sec; + format_add(ft, "client_created", "%ld", (long) t); + tim = ctime(&t); + *strchr(tim, '\n') = '\0'; + format_add(ft, "client_created_string", "%s", tim); + + t = c->activity_time.tv_sec; + format_add(ft, "client_activity", "%ld", (long) t); + tim = ctime(&t); + *strchr(tim, '\n') = '\0'; + format_add(ft, "client_activity_string", "%s", tim); + + if (c->tty.flags & TTY_UTF8) + format_add(ft, "client_utf8", "%d", 1); + else + format_add(ft, "client_utf8", "%d", 0); + + if (c->flags & CLIENT_READONLY) + format_add(ft, "client_readonly", "%d", 1); + else + format_add(ft, "client_readonly", "%d", 0); +} + /* Set default format keys for a winlink. */ void format_winlink(struct format_tree *ft, struct session *s, struct winlink *wl) diff --git a/trunk/tmux.1 b/trunk/tmux.1 index f56cf8d..39c7f66 100644 --- a/trunk/tmux.1 +++ b/trunk/tmux.1 @@ -2601,6 +2601,17 @@ if it is unattached. The following variables are available, where appropriate: .Bl -column "session_created_string" "Replaced with" -offset indent .It Sy "Variable name" Ta Sy "Replaced with" +.It Li "client_activity" Ta "Integer time client last had activity" +.It Li "client_activity_string" Ta "String time client last had activity" +.It Li "client_created" Ta "Integer time client created" +.It Li "client_created_string" Ta "String time client created" +.It Li "client_cwd" Ta "Working directory of client" +.It Li "client_height" Ta "Height of client" +.It Li "client_readonly" Ta "1 if client is readonly" +.It Li "client_termname" Ta "Terminal name of client" +.It Li "client_tty" Ta "Pseudo terminal of client" +.It Li "client_utf8" Ta "1 if client supports utf8" +.It Li "client_width" Ta "Width of client" .It Li "host" Ta "Hostname of local host" .It Li "line" Ta "Line number in the list" .It Li "pane_active" Ta "1 if active pane" diff --git a/trunk/tmux.h b/trunk/tmux.h index 74add28..12d401a 100644 --- a/trunk/tmux.h +++ b/trunk/tmux.h @@ -1360,6 +1360,7 @@ void format_add( const char *format_find(struct format_tree *, const char *); char *format_expand(struct format_tree *, const char *); voidformat_session(struct format_tree *, struct session *); +voidformat_client(struct format_tree *, struct client *); voidformat_winlink( struct format_tree *, struct session *, struct winlink *); voidformat_window_pane(struct format_tree *, struct window_pane *); -- 1.7.6.4 From b7e09931bb45fb42eb025748250e30a339757b83 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 20 Oct 2011 14:28:54 -0400 Subject: [PATCH 2/2] Use format strings in list-clients --- trunk/cmd-list-clients.c | 43 +++ trunk/tmux.1 |7 ++- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/trunk/cmd-list-cli
Re: Implement client format strings
On Thu, Oct 20, 2011 at 14:41:59 -0400, Ben Boeckel wrote: > I've also updated list-clients to use format strings and added > formatters for client information as well. I should really remember to look at strings and man pages *before* sending patches. *sigh*. --Ben From 540a72e8c927b864d5eae79a2cc1dba92e23c892 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 20 Oct 2011 14:43:13 -0400 Subject: [PATCH 3/3] Clean up strings for the new argument --- trunk/cmd-list-clients.c |2 +- trunk/tmux.1 |5 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/trunk/cmd-list-clients.c b/trunk/cmd-list-clients.c index 6b48c6e..3bbb1a0 100644 --- a/trunk/cmd-list-clients.c +++ b/trunk/cmd-list-clients.c @@ -32,7 +32,7 @@ int cmd_list_clients_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_list_clients_entry = { "list-clients", "lsc", "Ft:", 0, 0, - "[-F format]" CMD_TARGET_SESSION_USAGE, + "[-F format] " CMD_TARGET_SESSION_USAGE, CMD_READONLY, NULL, NULL, diff --git a/trunk/tmux.1 b/trunk/tmux.1 index 71f25b1..8b044c6 100644 --- a/trunk/tmux.1 +++ b/trunk/tmux.1 @@ -610,7 +610,10 @@ server and clients and destroy all sessions. .It Ic kill-session Op Fl t Ar target-session Destroy the given session, closing any windows linked to it and no other sessions, and detaching all clients attached to it. -.It Ic list-clients Op Fl F Op Fl t Ar target-session +.It Xo Ic list-clients +.Op Fl F Ar format +.Op Fl t Ar target-session +.Xc .D1 (alias: Ic lsc ) List all clients attached to the server. For the meaning of the -- 1.7.6.4 pgpdczat8JdWB.pgp Description: PGP signature -- The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Change colours in ins versus cmd edit mode
Hi, More patches :) . These add options for different message-{bg,fg,attr} colours when in command mode versus insert mode. They just have '-cmd' appended to the message name and the defaults are the inverse of the standard colours. Also updates vim syntax for them. --Ben From b0e3ea4777aa7b24d67b9749a9ae868ae0c968bd Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 20 Oct 2011 17:23:39 -0400 Subject: [PATCH 1/2] Options for changing colours in cmd vs ins modes There's currently no indication that you're in command or insert mode when using vi bindings for the command prompt. Add options for different colours. The defaults for command mode are inverted from insert mode by default. --- trunk/options-table.c | 15 +++ trunk/status.c| 18 +++--- trunk/tmux.1 |6 ++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/trunk/options-table.c b/trunk/options-table.c index 0832117..56f4a23 100644 --- a/trunk/options-table.c +++ b/trunk/options-table.c @@ -188,16 +188,31 @@ const struct options_table_entry session_options_table[] = { .default_num = 0 }, + { .name = "message-attr-cmd", + .type = OPTIONS_TABLE_ATTRIBUTES, + .default_num = 0 + }, + { .name = "message-bg", .type = OPTIONS_TABLE_COLOUR, .default_num = 3 }, + { .name = "message-bg-cmd", + .type = OPTIONS_TABLE_COLOUR, + .default_num = 0 + }, + { .name = "message-fg", .type = OPTIONS_TABLE_COLOUR, .default_num = 0 }, + { .name = "message-fg-cmd", + .type = OPTIONS_TABLE_COLOUR, + .default_num = 3 + }, + { .name = "message-limit", .type = OPTIONS_TABLE_NUMBER, .minimum = 0, diff --git a/trunk/status.c b/trunk/status.c index 1baab92..637b59a 100644 --- a/trunk/status.c +++ b/trunk/status.c @@ -919,9 +919,16 @@ status_prompt_redraw(struct client *c) off = 0; memcpy(&gc, &grid_default_cell, sizeof gc); - colour_set_fg(&gc, options_get_number(&s->options, "message-fg")); - colour_set_bg(&gc, options_get_number(&s->options, "message-bg")); - gc.attr |= options_get_number(&s->options, "message-attr"); + /* Change colours for ins versus cmd mode. */ + if (c->prompt_mdata.mode == 1) { + colour_set_fg(&gc, options_get_number(&s->options, "message-fg-cmd")); + colour_set_bg(&gc, options_get_number(&s->options, "message-bg-cmd")); + gc.attr |= options_get_number(&s->options, "message-attr-cmd"); + } else { + colour_set_fg(&gc, options_get_number(&s->options, "message-fg")); + colour_set_bg(&gc, options_get_number(&s->options, "message-bg")); + gc.attr |= options_get_number(&s->options, "message-attr"); + } screen_write_start(&ctx, NULL, &c->status); @@ -977,7 +984,12 @@ status_prompt_key(struct client *c, int key) c->flags |= CLIENT_STATUS; } break; + case MODEKEYEDIT_SWITCHMODE: + c->flags |= CLIENT_STATUS; + break; case MODEKEYEDIT_SWITCHMODEAPPEND: + c->flags |= CLIENT_STATUS; + /* FALLTHROUGH */ case MODEKEYEDIT_CURSORRIGHT: if (c->prompt_index < size) { c->prompt_index++; diff --git a/trunk/tmux.1 b/trunk/tmux.1 index f56cf8d..a4e3d38 100644 --- a/trunk/tmux.1 +++ b/trunk/tmux.1 @@ -1943,6 +1943,8 @@ or a comma-delimited list of one or more of: .Ic hidden , or .Ic italics . +.It Ic message-attr-cmd Ar attributes +Set status line message attributes when in 'command' mode. .It Ic message-bg Ar colour Set status line message background colour, where .Ar colour @@ -1963,8 +1965,12 @@ from the 256-colour set, or a hexadecimal RGB string such as .Ql #ff , which chooses the closest match from the default 256-colour set. +.It Ic message-bg-cmd Ar colour +Set status line message background colour when in 'command' mode. .It Ic message-fg Ar colour Set status line message foreground colour. +.It Ic message-fg-cmd Ar colour +Set status line message foreground colour when in 'command' mode. .It Ic message-limit Ar number Set the number of error or information messages to save in the message log for each client. -- 1.7.6.4 From 51eb86de879fa52dca380c3920f1007d6d0b2464 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 20 Oct 2011 17:27:19 -0400 Subject: [PATCH 2/2] Add command colour options to vim highlighting --- trunk/ex
Re: Implement pane_index format string
On Sun, Oct 23, 2011 at 02:17:19 +0100, Nicholas Marriott wrote: > Did you send a diff changing window_pane_index to behave like > window_index? I've got so many files all starting 000* now that I'm > confused ;-). Should be 0005-Change-window_pane_index-to-be-like-window_index.patch and 0006-Add-line-back-to-the-format-strings.patch for these. I'd link to them on sf.net, but it seems to think they're HTML messages and collapse them behind links which mangle the HTML that it isn't. > Or if you want to do that separately can you resend just the latest bits > for the pane index format string? I can do that as well if needed. --Ben pgpI4Jm2m4B9Q.pgp Description: PGP signature -- The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Implement word motion edit actions
On Sun, Oct 23, 2011 at 02:19:50 +0100, Nicholas Marriott wrote: > I know we want an excuse to add client options but I'm not convinced > this should be it - none of the mode options or key bindings or whatnot > are per client and it seems confusing to have two word-separators > options. Can't it use the existing session option? It's currently a window option which is why I made it a client option. Moving word-separators to being a session option altogether should nicely solve the issue, however. --Ben pgppPm1OVpOVv.pgp Description: PGP signature -- The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Change colours in ins versus cmd edit mode
On Sun, Oct 23, 2011 at 02:25:23 +0100, Nicholas Marriott wrote: > - I think I would call the option *-command not *-cmd and the attr/fg/bg > should be at the end, so how about message-command-{fg,bg,attr}? Can do (won't get to it until this afternoon though). > - No 's around command in the man page to match what it's like in > bind-key description (if there were quotes it would be .Ql or just > .Em but here I think they're unnecessary). I'll look at this closer (my font doesn't have italics and bole white isn't all that different than plain white either, so some styling is hard to see). --Ben pgpDgxjZnmxrN.pgp Description: PGP signature -- The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Change colours in ins versus cmd edit mode
On Thu, Oct 27, 2011 at 23:50:36 +0100, Nicholas Marriott wrote: > Man page I just meant remove the quotes, if you look at the bind-key bit > it just says: > > is bound in > .Ar key-table : > the binding for command mode with > .Fl c > > So there is no markup or quotes around the "command" in "command mode". Ah, whoops. New patches attached (they replace the previous ones). --Ben From 312a3ed02b61facec7290a44f6978949f1eefd3e Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 20 Oct 2011 17:23:39 -0400 Subject: [PATCH 1/2] Options for changing colours in cmd vs ins modes There's currently no indication that you're in command or insert mode when using vi bindings for the command prompt. Add options for different colours. The defaults for command mode are inverted from insert mode by default. --- trunk/options-table.c | 15 +++ trunk/status.c| 18 +++--- trunk/tmux.1 |6 ++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/trunk/options-table.c b/trunk/options-table.c index 0832117..ac090f7 100644 --- a/trunk/options-table.c +++ b/trunk/options-table.c @@ -193,6 +193,21 @@ const struct options_table_entry session_options_table[] = { .default_num = 3 }, + { .name = "message-command-attr", + .type = OPTIONS_TABLE_ATTRIBUTES, + .default_num = 0 + }, + + { .name = "message-command-bg", + .type = OPTIONS_TABLE_COLOUR, + .default_num = 0 + }, + + { .name = "message-command-fg", + .type = OPTIONS_TABLE_COLOUR, + .default_num = 3 + }, + { .name = "message-fg", .type = OPTIONS_TABLE_COLOUR, .default_num = 0 diff --git a/trunk/status.c b/trunk/status.c index 1baab92..8c97d5f 100644 --- a/trunk/status.c +++ b/trunk/status.c @@ -919,9 +919,16 @@ status_prompt_redraw(struct client *c) off = 0; memcpy(&gc, &grid_default_cell, sizeof gc); - colour_set_fg(&gc, options_get_number(&s->options, "message-fg")); - colour_set_bg(&gc, options_get_number(&s->options, "message-bg")); - gc.attr |= options_get_number(&s->options, "message-attr"); + /* Change colours for ins versus cmd mode. */ + if (c->prompt_mdata.mode == 1) { + colour_set_fg(&gc, options_get_number(&s->options, "message-command-fg")); + colour_set_bg(&gc, options_get_number(&s->options, "message-command-bg")); + gc.attr |= options_get_number(&s->options, "message-command-attr"); + } else { + colour_set_fg(&gc, options_get_number(&s->options, "message-fg")); + colour_set_bg(&gc, options_get_number(&s->options, "message-bg")); + gc.attr |= options_get_number(&s->options, "message-attr"); + } screen_write_start(&ctx, NULL, &c->status); @@ -977,7 +984,12 @@ status_prompt_key(struct client *c, int key) c->flags |= CLIENT_STATUS; } break; + case MODEKEYEDIT_SWITCHMODE: + c->flags |= CLIENT_STATUS; + break; case MODEKEYEDIT_SWITCHMODEAPPEND: + c->flags |= CLIENT_STATUS; + /* FALLTHROUGH */ case MODEKEYEDIT_CURSORRIGHT: if (c->prompt_index < size) { c->prompt_index++; diff --git a/trunk/tmux.1 b/trunk/tmux.1 index f56cf8d..4ef46fa 100644 --- a/trunk/tmux.1 +++ b/trunk/tmux.1 @@ -1963,6 +1963,12 @@ from the 256-colour set, or a hexadecimal RGB string such as .Ql #ff , which chooses the closest match from the default 256-colour set. +.It Ic message-command-attr Ar attributes +Set status line message attributes when in command mode. +.It Ic message-command-bg Ar colour +Set status line message background colour when in command mode. +.It Ic message-command-fg Ar colour +Set status line message foreground colour when in command mode. .It Ic message-fg Ar colour Set status line message foreground colour. .It Ic message-limit Ar number -- 1.7.6.4 From 924d4f2d85f146dc4842fa6d6bacbaa036549037 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 20 Oct 2011 17:27:19 -0400 Subject: [PATCH 2/2] Add command colour options to vim highlighting --- trunk/examples/tmux.vim | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/trunk/examples/tmux.vim b/trunk/examples/tmux.vim index d21c377..6912b56 100644 --- a/trunk/examples/tmux.vim +++ b/trunk/examples/tmux.vim @@ -47,11 +47,11 @@ syn keyword tmuxCmds capture-pane joinp join-pane choose-buffer syn keyword tmuxOptsSet prefix status status-fg
Re: Implement pane_index format string
On Thu, Oct 27, 2011 at 23:48:05 +0100, Nicholas Marriott wrote: > Can you resend the diff apart from the window index change and I'll > apply it? Sorry, a little confused here; probably shouldn't do hacking this late. What is needed exactly? --Ben pgpqiuU2M6ksR.pgp Description: PGP signature -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Implement client format strings
On Sun, Oct 23, 2011 at 02:14:20 +0100, Nicholas Marriott wrote: > You're missing a : after F in the getopt args so this doesn't work ;-). Gah. I thought I had that... Too many feature patches to test. > I fixed that and applied this now, thanks. Thanks. --Ben pgpyVezXjFsxq.pgp Description: PGP signature -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Implement word motion edit actions
On Mon, Oct 24, 2011 at 13:11:06 -0400, Ben Boeckel wrote: > On Sun, Oct 23, 2011 at 02:19:50 +0100, Nicholas Marriott wrote: > > I know we want an excuse to add client options but I'm not convinced > > this should be it - none of the mode options or key bindings or whatnot > > are per client and it seems confusing to have two word-separators > > options. Can't it use the existing session option? > > It's currently a window option which is why I made it a client option. > Moving word-separators to being a session option altogether should > nicely solve the issue, however. Patches attached to move it to being a session-option. For the release notes, this will break backwards compatability. --Ben From ca148f16207691e216de26cc3602763acae4eff2 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 11 Nov 2011 16:31:44 -0500 Subject: [PATCH 1/9] Whitespace fixes --- trunk/compat/getopt.c |2 +- trunk/options-table.c |5 ++--- trunk/tmux.h |4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/trunk/compat/getopt.c b/trunk/compat/getopt.c index f6ecb58..b7b8582 100644 --- a/trunk/compat/getopt.c +++ b/trunk/compat/getopt.c @@ -108,7 +108,7 @@ BSDgetopt(nargc, nargv, ostr) __progname, BSDoptopt); return (BADCH); } - else/* white space */ + else/* white space */ BSDoptarg = nargv[BSDoptind]; place = EMSG; ++BSDoptind; diff --git a/trunk/options-table.c b/trunk/options-table.c index 1bdb0de..2b72fb6 100644 --- a/trunk/options-table.c +++ b/trunk/options-table.c @@ -388,8 +388,8 @@ const struct options_table_entry session_options_table[] = { { .name = "terminal-overrides", .type = OPTIONS_TABLE_STRING, .default_str = "*88col*:colors=88,*256col*:colors=256" -",xterm*:XT:Ms=\\E]52;%p1%s;%p2%s\\007" -":Cc=\\E]12;%p1%s\\007:Cr=\\E]112\\007" +",xterm*:XT:Ms=\\E]52;%p1%s;%p2%s\\007" +":Cc=\\E]12;%p1%s\\007:Cr=\\E]112\\007" ":Cs=\\E[%p1%d q:Csr=\\E[2 q,screen*:XT" }, @@ -397,7 +397,6 @@ const struct options_table_entry session_options_table[] = { .type = OPTIONS_TABLE_STRING, .default_str = "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID " "SSH_CONNECTION WINDOWID XAUTHORITY" - }, { .name = "visual-activity", diff --git a/trunk/tmux.h b/trunk/tmux.h index 08650d5..514df8f 100644 --- a/trunk/tmux.h +++ b/trunk/tmux.h @@ -843,7 +843,7 @@ RB_HEAD(window_pane_tree, window_pane); struct window { char*name; struct event name_timer; - struct timeval silence_timer; + struct timeval silence_timer; struct window_pane *active; struct window_pane *last; @@ -876,7 +876,7 @@ struct winlink { struct grid_cell status_cell; char*status_text; - int flags; + int flags; #define WINLINK_BELL 0x1 #define WINLINK_ACTIVITY 0x2 #define WINLINK_CONTENT 0x4 -- 1.7.6.4 From 3d7857c61ffd1f9ab9aab36d16f693101829f1ad Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 11 Nov 2011 16:44:54 -0500 Subject: [PATCH 2/9] Make word-separators a session option --- trunk/examples/tmux.vim |4 ++-- trunk/options-table.c | 10 +- trunk/tmux.1| 15 +++ trunk/window-copy.c |6 +++--- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/trunk/examples/tmux.vim b/trunk/examples/tmux.vim index ae24be7..e738d33 100644 --- a/trunk/examples/tmux.vim +++ b/trunk/examples/tmux.vim @@ -61,7 +61,7 @@ syn keyword tmuxOptsSet mouse-select-pane message-limit quiet escape-time syn keyword tmuxOptsSet pane-active-border-bg pane-active-border-fg syn keyword tmuxOptsSet pane-border-bg pane-border-fg message-[command-]fg syn keyword tmuxOptsSet display-panes-active-colour alternate-screen -syn keyword tmuxOptsSet detach-on-destroy +syn keyword tmuxOptsSet detach-on-destroy word-separators syn keyword tmuxOptsSetw monitor-activity aggressive-resize force-width syn keyword tmuxOptsSetw force-height remain-on-exit uft8 mode-fg mode-bg @@ -72,7 +72,7 @@ syn keyword tmuxOptsSetw main-pane-width main-pane-height monitor-content syn keyword tmuxOptsSetw window-status-current-attr window-status-current-bg syn keyword tmuxOptsSetw window-status-current-fg mode-mouse synchronize-panes syn keyword tmuxOptsSetw window-status-format window-status-current-format -syn keyword tmuxOptsSetw word-separators window-status-alert-attr +syn keyword tmuxOptsSetw w
Re: Implement pane_index format string
On Sat, Nov 05, 2011 at 09:03:03 +, Nicholas Marriott wrote: > - window_pane_index change is a > separate thing I guess. Attached. --Ben From a1da8eef7dec2fd729927d33ebc6c3bfde54031a Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 20 Oct 2011 12:03:55 -0400 Subject: [PATCH] Change window_pane_index to be like window_index --- trunk/cmd-respawn-pane.c |7 +-- trunk/cmd-split-window.c |3 ++- trunk/screen-redraw.c|5 +++-- trunk/status.c |5 - trunk/tmux.h |2 +- trunk/window.c | 18 ++ 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/trunk/cmd-respawn-pane.c b/trunk/cmd-respawn-pane.c index 7e272a8..d4d67d5 100644 --- a/trunk/cmd-respawn-pane.c +++ b/trunk/cmd-respawn-pane.c @@ -49,15 +49,18 @@ cmd_respawn_pane_exec(struct cmd *self, struct cmd_ctx *ctx) struct session *s; struct environ env; const char *cmd; - char*cause; + char*cause; + u_intidx; if ((wl = cmd_find_pane(ctx, args_get(args, 't'), &s, &wp)) == NULL) return (-1); w = wl->window; if (!args_has(self->args, 'k') && wp->fd != -1) { + if (window_pane_index(wp, &idx) != 0) + fatalx("index not found"); ctx->error(ctx, "pane still active: %s:%u.%u", - s->name, wl->idx, window_pane_index(w, wp)); + s->name, wl->idx, idx); return (-1); } diff --git a/trunk/cmd-split-window.c b/trunk/cmd-split-window.c index 6a95e1b..258c632 100644 --- a/trunk/cmd-split-window.c +++ b/trunk/cmd-split-window.c @@ -139,7 +139,8 @@ cmd_split_window_exec(struct cmd *self, struct cmd_ctx *ctx) environ_free(&env); if (args_has(args, 'P')) { - paneidx = window_pane_index(wl->window, new_wp); + if (window_pane_index(new_wp, &paneidx) != 0) + fatalx("index not found"); ctx->print(ctx, "%s:%u.%u", s->name, wl->idx, paneidx); } return (0); diff --git a/trunk/screen-redraw.c b/trunk/screen-redraw.c index a12fa36..c9e0542 100644 --- a/trunk/screen-redraw.c +++ b/trunk/screen-redraw.c @@ -264,7 +264,7 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp) { struct tty *tty = &c->tty; struct session *s = c->session; - struct options *oo = &s->options; + struct options *oo = &s->options; struct window *w = wp->window; struct grid_cell gc; u_intidx, px, py, i, j, xoff, yoff; @@ -272,7 +272,8 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp) char buf[16], *ptr; size_t len; - idx = window_pane_index(w, wp); + if (window_pane_index(wp, &idx) != 0) + fatalx("index not found"); len = xsnprintf(buf, sizeof buf, "%u", idx); if (wp->sx < len) diff --git a/trunk/status.c b/trunk/status.c index 5db40b4..ca3e9d4 100644 --- a/trunk/status.c +++ b/trunk/status.c @@ -372,6 +372,7 @@ status_replace1(struct client *c, struct session *s, struct winlink *wl, charch, tmp[256], *ptr, *endptr, *freeptr; size_t ptrlen; longlimit; + u_int idx; if (s == NULL) s = c->session; @@ -422,8 +423,10 @@ status_replace1(struct client *c, struct session *s, struct winlink *wl, ptr = tmp; goto do_replace; case 'P': + if (window_pane_index(wp, &idx) != 0) + fatalx("index not found"); xsnprintf( - tmp, sizeof tmp, "%u", window_pane_index(wl->window, wp)); + tmp, sizeof tmp, "%u", idx); ptr = tmp; goto do_replace; case 'S': diff --git a/trunk/tmux.h b/trunk/tmux.h index 08650d5..be8f296 100644 --- a/trunk/tmux.h +++ b/trunk/tmux.h @@ -1927,7 +1927,7 @@ struct window_pane *window_pane_next_by_number(struct window *, struct window_pane *, u_int); struct window_pane *window_pane_previous_by_number(struct window *, struct window_pane *, u_int); -u_int window_pane_index(struct window *, struct window_pane *); +int window_pane_index(struct window_pane *, u_int *); u_int window_count_panes(struct window *); voidwindow_destroy_panes(struct
Re: Implement pane_index format string
On Sat, Nov 05, 2011 at 09:03:03 +, Nicholas Marriott wrote: > - -F pane_index, need the latest version. Attached. They apply on top of the window_pane_index fix. --Ben From eda10065bbcc951ce4df8cc86979b0ae0262d0b6 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 11 Nov 2011 17:10:04 -0500 Subject: [PATCH 1/2] Implement the pane_index format string --- trunk/format.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/trunk/format.c b/trunk/format.c index 74df2ab..713c952 100644 --- a/trunk/format.c +++ b/trunk/format.c @@ -361,6 +361,7 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp) struct grid_line*gl; unsigned long long size; u_inti; + u_intidx; size = 0; for (i = 0; i < gd->hsize; i++) { @@ -370,9 +371,13 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp) } size += gd->hsize * sizeof *gd->linedata; + if (window_pane_index(wp, &idx) != 0) + fatalx("index not found"); + format_add(ft, "pane_width", "%u", wp->sx); format_add(ft, "pane_height", "%u", wp->sy); format_add(ft, "pane_title", "%s", wp->base.title); + format_add(ft, "pane_index", "%u", idx); format_add(ft, "history_size", "%u", gd->hsize); format_add(ft, "history_limit", "%u", gd->hlimit); format_add(ft, "history_bytes", "%llu", size); -- 1.7.6.4 From 10c603b9c44649cfe1593ddb9fbe7fc7141a1f6b Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 19 Oct 2011 17:39:31 -0400 Subject: [PATCH 2/2] Use the pane_index format string --- trunk/cmd-list-panes.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/trunk/cmd-list-panes.c b/trunk/cmd-list-panes.c index 723c703..7331abd 100644 --- a/trunk/cmd-list-panes.c +++ b/trunk/cmd-list-panes.c @@ -102,21 +102,21 @@ cmd_list_panes_window(struct cmd *self, if (template == NULL) { switch (type) { case 0: - template = "#{line}: " + template = "#{pane_index}: " "[#{pane_width}x#{pane_height}] [history " "#{history_size}/#{history_limit}, " "#{history_bytes} bytes] #{pane_id}" "#{?pane_active, (active),}#{?pane_dead, (dead),}"; break; case 1: - template = "#{window_index}.#{line}: " + template = "#{window_index}.#{pane_index}: " "[#{pane_width}x#{pane_height}] [history " "#{history_size}/#{history_limit}, " "#{history_bytes} bytes] #{pane_id}" "#{?pane_active, (active),}#{?pane_dead, (dead),}"; break; case 2: - template = "#{session_name}:#{window_index}.#{line}: " + template = "#{session_name}:#{window_index}.#{pane_index}: " "[#{pane_width}x#{pane_height}] [history " "#{history_size}/#{history_limit}, " "#{history_bytes} bytes] #{pane_id}" -- 1.7.6.4 pgp9Jt5VSWmGB.pgp Description: PGP signature -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Jump/search memory
Hi, In Vim, the last jump target character and search string are remembered so that subsequent 'n', 'N', ';', and ',' commands work without needing to put the search again. Looking at the code, it doesn't seem *too* hard to do, but it would require swapping out the switch statements to check for NULL in the search and jump memory variables instead. Would this be wanted? As a side note, I have 't' and 'T' implemented for copy mode here (testing them before doing work to bring the window_copy_cursor_jump* functions together (since adding jump_to and jump_to_back makes it four copies of really similar code) into one. I'll work on adding the movements to the status line as well (though these might be overkill). --Ben P.S. It seems that the svn mirror (on github) is behind. It has the following as the latest diff: +- append to buffer in copy mode The obsd mirror (also on github) has the word movement patches already. -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Implement word motion edit actions
On Fri, Nov 25, 2011 at 18:32:40 +0100, Romain Francoise wrote: > Did you test this patch series in emacs editing mode? M-f doesn't behave > as it should, I'd expect it to move the cursor *after* the current word > but it goes back to the last letter. This is inconsistent with the > existing copy-mode implementation (and Emacs, readline, etc). Honestly no. I'm not familiar with emacs and I'd have just tested that they worked the same as in vi mode. Is M-f the same as 'e' in vi (end of next word)? I suppose that the same logic that copy mode is now doing to differentiate the two could be done there. --Ben -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Jump/search memory
On Sun, Nov 27, 2011 at 03:00:50 +, Nicholas Marriott wrote: > Don't n and N etc remember it already? I can just keep pressing N to > search... > > I don't mind remembering anything else too. Ah, yep. I missed that in the code. I can't remember what made me think it wasn't done... > > As a side note, I have 't' and 'T' implemented for copy mode here > > (testing them before doing work to bring the window_copy_cursor_jump* > > functions together (since adding jump_to and jump_to_back makes it four > > copies of really similar code) into one. I'll work on adding the > > movements to the status line as well (though these might be overkill). > > Ok cool. I got the window copy part of it done. I don't know how the status one should work...there's no way to get the character to jump to without using the status line (or to wait for it silently like vi, but that may be unwanted). Word jumping and number modified 'h' and 'l' should suffice I'd think. Patches attached. I also added bindings for 'x' and 'X' in vi normal mode for the status line to be delete and backspace, respectively. --Ben From f3939af7571983f646fbcdbd505d3d8240f9937d Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 30 Nov 2011 21:43:16 -0500 Subject: [PATCH 1/5] Add bindings for jump-to and jump-to-back --- trunk/mode-key.c|6 ++ trunk/tmux.h|2 ++ trunk/window-copy.c |2 ++ 3 files changed, 10 insertions(+), 0 deletions(-) diff --git a/trunk/mode-key.c b/trunk/mode-key.c index e45f1c6..c848b79 100644 --- a/trunk/mode-key.c +++ b/trunk/mode-key.c @@ -98,6 +98,8 @@ const struct mode_key_cmdstr mode_key_cmdstr_copy[] = { { MODEKEYCOPY_JUMPAGAIN, "jump-again" }, { MODEKEYCOPY_JUMPREVERSE, "jump-reverse" }, { MODEKEYCOPY_JUMPBACK, "jump-backward" }, + { MODEKEYCOPY_JUMPTO, "jump-to-forward" }, + { MODEKEYCOPY_JUMPTOBACK, "jump-to-backward" }, { MODEKEYCOPY_LEFT, "cursor-left" }, { MODEKEYCOPY_RECTANGLETOGGLE, "rectangle-toggle" }, { MODEKEYCOPY_MIDDLELINE, "middle-line" }, @@ -223,6 +225,7 @@ const struct mode_key_entry mode_key_vi_copy[] = { { 'L', 0, MODEKEYCOPY_BOTTOMLINE }, { 'M', 0, MODEKEYCOPY_MIDDLELINE }, { 'N', 0, MODEKEYCOPY_SEARCHREVERSE }, + { 'T', 0, MODEKEYCOPY_JUMPTOBACK }, { 'W', 0, MODEKEYCOPY_NEXTSPACE }, { '\002' /* C-b */, 0, MODEKEYCOPY_PREVIOUSPAGE }, { '\003' /* C-c */, 0, MODEKEYCOPY_CANCEL }, @@ -244,6 +247,7 @@ const struct mode_key_entry mode_key_vi_copy[] = { { 'k', 0, MODEKEYCOPY_UP }, { 'l', 0, MODEKEYCOPY_RIGHT }, { 'n', 0, MODEKEYCOPY_SEARCHAGAIN }, + { 't', 0, MODEKEYCOPY_JUMPTO }, { 'q', 0, MODEKEYCOPY_CANCEL }, { 'v', 0, MODEKEYCOPY_RECTANGLETOGGLE }, { 'w', 0, MODEKEYCOPY_NEXTWORD }, @@ -335,6 +339,7 @@ const struct mode_key_entry mode_key_emacs_copy[] = { { 'N', 0, MODEKEYCOPY_SEARCHREVERSE }, { 'R' | KEYC_ESCAPE,0, MODEKEYCOPY_TOPLINE }, { 'R', 0, MODEKEYCOPY_RECTANGLETOGGLE }, + { 'T', 0, MODEKEYCOPY_JUMPTOBACK }, { '\000' /* C-Space */, 0, MODEKEYCOPY_STARTSELECTION }, { '\001' /* C-a */, 0, MODEKEYCOPY_STARTOFLINE }, { '\002' /* C-b */, 0, MODEKEYCOPY_LEFT }, @@ -359,6 +364,7 @@ const struct mode_key_entry mode_key_emacs_copy[] = { { 'n', 0, MODEKEYCOPY_SEARCHAGAIN }, { 'q', 0, MODEKEYCOPY_CANCEL }, { 'r' | KEYC_ESCAPE,0, MODEKEYCOPY_MIDDLELINE }, + { 't', 0, MODEKEYCOPY_JUMPTO }, { 'v' | KEYC_ESCAPE,0, MODEKEYCOPY_PREVIOUSPAGE }, { 'w' | KEYC_ESCAPE,0, MODEKEYCOPY_COPYSELECTION }, { KEYC_DOWN | KEYC_CTRL,0, MODEKEYCOPY_SCROLLDOWN }, diff --git a/trunk/tmux.h b/trunk/tmux.h index 8c9f9e7..dc168c9 100644 --- a/trunk/tmux.h +++ b/trunk/tmux.h @@ -481,6 +481,8 @@ enum mode_key_cmd { MODEKEYCOPY_JUMPAGAIN, MODEKEYCOPY_JUMPREVERSE, MODEKEYCOPY_JUMPBACK, + MODEKEYCOPY_JUMPTO, + MODEKEYCOPY_JUMPTOBACK, MODEKEYCOPY_LEFT, MODEKEYCOPY_MIDDLELINE, MODEKEYCOPY_NEXTPAGE, diff --git a/trunk/window-copy.c b/trunk/wind
Feature branches
Hi, Another handful of features incoming[1]. Not all are ready[2], but some are. The branches are as follows: dev/add-WORD-motions-to-status Adds 'B', 'E', and 'W' motions to edit mode. Not sure of emacs equivalents. dev/add-line-insert Adds 'A' and 'I' bindings for vi in edit mode. Not sure of emacs equivalents. dev/add-till-movement (SENT in another thread) Adds 't' and 'T' motions to copy mode. I'm unsure of the emacs equivalent bindings for these. Also contains bindings for 'x' and 'X' in edit mode for vi. Again, not sure of emacs equivalents. There's an extra commit that does the groundwork for the 't' and 'T' bindings in edit mode, but there's no way to get the target character without being silent or recursing in the status line. dev/fix-vi-motion-targets (BUGGY) Fixes 'e' and 'E' motions to have vi-like behavior if the respective table is set for copy and edit modes. dev/use-format-tree-in-display (NEEDS DOCS) Allow formatting like list-* commands in the statusline (client and session formats globally) and display-message (which also adds the window and pane formats). dev/features Integration branch with all of the above merged in. This is what I'm using on my development machines. I'd like to get testing for these besides my use. Also input from emacs users as to what the equivalent bindings for some of the vi bindings are. Also master is a bit behind. Fair warning: I rebase feature branches (especially since master grabs the patches as slightly different sometimes and rebasing to resolve what's been merged is easiest). There are also quite a few merge conflicts among the branches because quite a few poke at edit mode bindings. --Ben [1]http://git.benboeckel.net/patches/tmux.git/ [2]There's some weird bugs with word motions in particular with the fix to make it follow the vi convention of ending on the last character of a word instead of the character after the word. There's also some weirdness in the status line with word motions. pgpoC9BYSd4lw.pgp Description: PGP signature -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Feature branches
On Fri, Dec 02, 2011 at 00:24:00 -0500, Ben Boeckel wrote: > dev/add-WORD-motions-to-status > Adds 'B', 'E', and 'W' motions to edit mode. Not sure of emacs > equivalents. Works here. It uses the emacs 'E' behavior. I have another branch here which fixes the behavior when vi behavior of 'e' and 'E' where applicable. --Ben pgpT8rV279w1C.pgp Description: PGP signature -- RSA(R) Conference 2012 Mar 27 - Feb 2 Save $400 by Jan. 27 Register now! http://p.sf.net/sfu/rsa-sfdev2dev2___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Feature branches
On Thu, Jan 12, 2012 at 21:15:30 -0500, Ben Boeckel wrote: > On Fri, Dec 02, 2011 at 00:24:00 -0500, Ben Boeckel wrote: > > dev/add-WORD-motions-to-status > > Adds 'B', 'E', and 'W' motions to edit mode. Not sure of emacs > > equivalents. > > Works here. It uses the emacs 'E' behavior. I have another branch here > which fixes the behavior when vi behavior of 'e' and 'E' where > applicable. And let's actually attach the patch... --Ben From f9c64aa28a09fb7092d52d2001b25ab9794b5743 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 12 Jan 2012 20:50:51 -0500 Subject: [PATCH] Add WORD motions to status line editing --- trunk/mode-key.c |6 ++ trunk/status.c | 20 trunk/tmux.h |3 +++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/trunk/mode-key.c b/trunk/mode-key.c index bfa8b4a..c8581d7 100644 --- a/trunk/mode-key.c +++ b/trunk/mode-key.c @@ -54,9 +54,12 @@ const struct mode_key_cmdstr mode_key_cmdstr_edit[] = { { MODEKEYEDIT_ENTER, "enter" }, { MODEKEYEDIT_HISTORYDOWN, "history-down" }, { MODEKEYEDIT_HISTORYUP, "history-up" }, + { MODEKEYEDIT_NEXTSPACE, "next-space" }, + { MODEKEYEDIT_NEXTSPACEEND, "next-space-end" }, { MODEKEYEDIT_NEXTWORD, "next-word" }, { MODEKEYEDIT_NEXTWORDEND, "next-word-end" }, { MODEKEYEDIT_PASTE, "paste" }, + { MODEKEYEDIT_PREVIOUSSPACE, "previous-space" }, { MODEKEYEDIT_PREVIOUSWORD, "previous-word" }, { MODEKEYEDIT_STARTOFLINE, "start-of-line" }, { MODEKEYEDIT_SWITCHMODE, "switch-mode" }, @@ -148,7 +151,10 @@ const struct mode_key_entry mode_key_vi_edit[] = { { '$', 1, MODEKEYEDIT_ENDOFLINE }, { '0', 1, MODEKEYEDIT_STARTOFLINE }, + { 'B', 1, MODEKEYEDIT_PREVIOUSSPACE }, { 'D', 1, MODEKEYEDIT_DELETETOENDOFLINE }, + { 'E', 1, MODEKEYEDIT_NEXTSPACEEND }, + { 'W', 1, MODEKEYEDIT_NEXTSPACE }, { 'X', 1, MODEKEYEDIT_BACKSPACE }, { '\003' /* C-c */, 1, MODEKEYEDIT_CANCEL }, { '\010' /* C-h */, 1, MODEKEYEDIT_BACKSPACE }, diff --git a/trunk/status.c b/trunk/status.c index 49836a2..154bd6c 100644 --- a/trunk/status.c +++ b/trunk/status.c @@ -978,7 +978,7 @@ status_prompt_key(struct client *c, int key) struct paste_buffer *pb; char*s, *first, *last, word[64], swapc; const char *histstr; - const char *wsep; + const char *wsep = NULL; u_char ch; size_t size, n, off, idx; @@ -1124,8 +1124,12 @@ status_prompt_key(struct client *c, int key) c->prompt_index = idx; c->flags |= CLIENT_STATUS; break; + case MODEKEYEDIT_NEXTSPACE: + wsep = " "; + /* FALLTHROUGH */ case MODEKEYEDIT_NEXTWORD: - wsep = options_get_string(oo, "word-separators"); + if (wsep == NULL) + wsep = options_get_string(oo, "word-separators"); /* Find a separator. */ while (c->prompt_index != size) { @@ -1143,8 +1147,12 @@ status_prompt_key(struct client *c, int key) c->flags |= CLIENT_STATUS; break; + case MODEKEYEDIT_NEXTSPACEEND: + wsep = " "; + /* FALLTHROUGH */ case MODEKEYEDIT_NEXTWORDEND: - wsep = options_get_string(oo, "word-separators"); + if (wsep == NULL) + wsep = options_get_string(oo, "word-separators"); /* Find a word. */ while (c->prompt_index != size) { @@ -1162,8 +1170,12 @@ status_prompt_key(struct client *c, int key) c->flags |= CLIENT_STATUS; break; + case MODEKEYEDIT_PREVIOUSSPACE: + wsep = " "; + /* FALLTHROUGH */ case MODEKEYEDIT_PREVIOUSWORD: - wsep = options_get_string(oo, "word-separators"); + if (wsep == NULL) + wsep = options_get_string(oo, "word-separators"); /* Find a non-separator. */ while (c->prompt_index != 0) { diff --git a/trunk/tmux.h b/trunk/tmux.h index 6553388..afeba8b 100644 --- a/trunk/tmux.h +++ b/trunk/tmux.h @@ -443,9 +443,12 @@ enum mode_key_cmd { MODEKEYEDIT_
Re: Try the iTerm2/tmux integration
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Sun, Jan 22, 2012 at 20:13:20 GMT, George Nachman wrote: > IDs > > Windows had no race-free identifier. I defined window IDs as a > monotonically increasing integer assigned at window creation time, and > referenced with an @ sign. For instance "unlink window -t @1". +1 > Sessions had no unique identifier. Add a monotonically increasing > session ID assigned at creation time. +1. What is the symbol for this? Not much is left that doesn't clash with common shell things. One of '!', '&', or '#' maybe? > Window panes had no race-free identifier. I defined pane IDs as a > monotonically increasing integer assigned at creation time, and > referenced with a % sign. For instance "break-pane -t %1". This is in trunk already. Is this duplicating that functionality? - --Ben (I have a nearly-complete zsh completion module for tmux and like to keep it up to date with patches.) -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBCgAGBQJPHhESAAoJEKaxavVX4C1XkvwQAOFNiTCLBE7wBj4Ixhq84BkG 7UUeDaUOqaj+8A48fVY7K314CHETSsiE2ELhT/4+uHh1Qeq+QDafmVZoRkeAyv5V UAWR9m0C+svYYWaa3E6YIthTI6C8rgHxqGuv8vvuyVKhIsNhB+/IimxY86cHyJUl 4UudnmOmPPmMzrswub22s2EvFFp9ZCbIKUEOtzatVMuWo6qYW9Gm7g3Lwo80BWHN 5K4gw4/YJiydpfCLB1r2iMFez85j0E2JLxLSlRBys3Hb5DjhtlquiW/MX6CAMAI1 f+fBVOWpsen0IYMpJmBKi+zu93z2EMbVAMRjjhK8y36pMlqUo2KBII1s9tfUccBj e+W1yAfe5EgL6HgqtT/g4cdqT71rB5HZkd0qLyMvseHpPwLh8SHL1uG8P7yXNPqu GVoVv/ARuhEzXogUoIrbXqXBDAklpe7kXzRLNUi7rMq9ddloUj0ZeNPx3PnYSebP H02fplTYMenapjgQketOeb6BZhIkbZUJtT+deigtqaHxgGGxfmPPKI3UnbBKqt3m Gnx2n797HUnUD7DZA4NIr9c1VOL6M5QjAF3tkfvosbNlmyLdNyeS2Ul1XYnDq9Sh BWVppJEadOpuTZUYpH3m9d1T5uMHC29NJl/XE4yMwgL9aF66bT1NcaKsc/zJ9aLz oQsPVMJdU4JtuykFxsKR =ZNO8 -END PGP SIGNATURE- -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Patch: add window ID and session ID. Make window pane ID and window ID referencable in targets. Improve list-windows.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Sun, Jan 29, 2012 at 22:35:57 GMT, Nicholas Marriott wrote: > I'm not sure if you told me, but what are you using the session id for? > Session names are unique, so why is another id desirable? Names can change; the ID would not. Controlling tmux from external programs is much easier when the actual working set that the tool cares about can be managed directly. This way users swapping panes and windows around don't get caught in any crossfire. An example would be some sort of monitoring tool that watches some jobs and swaps panes into a window for notifications of things and such. This window could then be moved out of the way and around sessions as needed without locking a position in some session down as the target. - --Ben -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBCgAGBQJPJ2BeAAoJEKaxavVX4C1XrqMQAMmqXgnfD5tgZ61EGF0KLebL lv71fp2XahNJuNoRbtX4u4etCKyP5KZwnF53UPLAD81dfegk9HinjuPrrAmc3M2E VKW5ZKsMru3ipKE3d6jh7qPbRFyBKglRHHiEpG7NvrbPMCPrOlVdjrFnM+yYVLz+ 84CIJGyM4wfi52MafIoG70TwwpCbkAxtfc2uQqEyywoXVhkfG0n3yrGA+O2n5qgO ODEG8ZMXKsWUElh7m3jZ26plP2gabAWrKkVL7CVOweNM1lQIUa+sUAKmrc7J6fks NHYDzOoV68o9c/XZ1Ba762lIcXaqDfDMjrDt4tZFWgC9RbsK1VCEXhtfXrKY1fPW CaHJjteGm0qKsRe3V74PWWNM4FebFuc8gztfKksG2SUItISVvRP906cmRqhsBfJH 4L8e0WWffwWq9U/cthw9a0HKJ4JLeLwwOpDwevTtkK/pEWGLMtancswBc6+0s4bg toVW7fNMaT/McZVnBXATRydUYRe4ru8x0Uj52MzWwrWfVCVwve4QS/ZGC7havziR an4ySZ/0C7Qrgxn78t93ODWPAMBdKUM2AAY141ocncz0mECGfbU6j6oBPyU79Ugs BhooXt+Bm5q9lhy7dglSYwUEA7YjU1bYFXeeQa+wr4IjBB4goydE3fLXdjnREC0X EYCAfklTrnTrN8QaKPzc =Nv+W -END PGP SIGNATURE- -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Permission error when getting cwd
If you have a process running in a window and create a new window with it focused, a NULL dereference can occur if the process is not owned by the user (e.g., a root shell). Patch attached. --Ben >From c9d364132951dcba3a46af008d00edbb0ac6355d Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 5 Feb 2012 23:38:24 -0500 Subject: [PATCH] Handle the case where root is NULL If osdep_get_cwd returns NULL, the root[skip] causes a NULL dereference. In this case, avoid jumping to the complete_path label. Falling through and returning s->cwd should be "good enough". This occurs when the pid of the window is not accessible by the user (e.g., a root shell). --- trunk/cmd.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/trunk/cmd.c b/trunk/cmd.c index a58b0d5..7ba29e0 100644 --- a/trunk/cmd.c +++ b/trunk/cmd.c @@ -1308,7 +1308,8 @@ cmd_get_default_path(struct cmd_ctx *ctx, const char *cwd) else return (s->cwd); skip = 0; - goto complete_path; + if (root == NULL) + goto complete_path; } return (s->cwd); -- 1.7.6.5 -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Minor touchups
Two (separate) patches. The first updates vim syntax for new options in trunk. The second re-alphabetizes the session option table data again. --Ben >From de4721ca01405d526f7a8a90f8784cc66f3189ea Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 6 Feb 2012 00:05:03 -0500 Subject: [PATCH 2/3] Update vim syntax highlighting --- trunk/examples/tmux.vim | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/trunk/examples/tmux.vim b/trunk/examples/tmux.vim index 2b72176..e12428a 100644 --- a/trunk/examples/tmux.vim +++ b/trunk/examples/tmux.vim @@ -44,10 +44,10 @@ syn keyword tmuxCmds run[-shell] lockc lock-client locks lock-session lsp syn keyword tmuxCmds list-panes pipep pipe-pane showmsgs show-messages capturep syn keyword tmuxCmds capture-pane joinp join-pane choose-buffer -syn keyword tmuxOptsSet prefix status status-fg status-bg bell-action +syn keyword tmuxOptsSet prefix prefix2 status status-fg status-bg bell-action syn keyword tmuxOptsSet default-command history-limit status-left status-right syn keyword tmuxOptsSet status-interval set-titles display-time buffer-limit -syn keyword tmuxOptsSet status-left-length status-right-length +syn keyword tmuxOptsSet status-left-length status-right-length status-position syn keyword tmuxOptsSet message-[command-]bg lock-after-time default-path syn keyword tmuxOptsSet message-[command-]attr status-attr set-remain-on-exit syn keyword tmuxOptsSet status-utf8 default-terminal visual-activity repeat-time @@ -74,8 +74,12 @@ syn keyword tmuxOptsSetw main-pane-width main-pane-height monitor-content syn keyword tmuxOptsSetw window-status-current-attr window-status-current-bg syn keyword tmuxOptsSetw window-status-current-fg mode-mouse synchronize-panes syn keyword tmuxOptsSetw window-status-format window-status-current-format -syn keyword tmuxOptsSetw window-status-alert-attr -syn keyword tmuxOptsSetw window-status-alert-bg window-status-alert-fg +syn keyword tmuxOptsSetw window-status-activity-attr +syn keyword tmuxOptsSetw window-status-activity-bg window-status-activity-fg +syn keyword tmuxOptsSetw window-status-bell-attr +syn keyword tmuxOptsSetw window-status-bell-bg window-status-bell-fg +syn keyword tmuxOptsSetw window-status-content-attr +syn keyword tmuxOptsSetw window-status-content-bg window-status-content-fg syn keyword tmuxOptsSetw pane-base-index other-pane-height other-pane-width syn keyword tmuxTodo FIXME NOTE TODO XXX contained -- 1.7.6.5 >From 27658f4ffe985692f17dbbf9b79af42e5696f09c Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 6 Feb 2012 00:05:53 -0500 Subject: [PATCH 3/3] Alphabetize session options --- trunk/options-table.c | 18 +- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/trunk/options-table.c b/trunk/options-table.c index d5b8d21..8f52516 100644 --- a/trunk/options-table.c +++ b/trunk/options-table.c @@ -583,47 +583,47 @@ const struct options_table_entry window_options_table[] = { .default_num = 0 /* overridden in main() */ }, - { .name = "window-status-bell-attr", + { .name = "window-status-activity-attr", .type = OPTIONS_TABLE_ATTRIBUTES, .default_num = GRID_ATTR_REVERSE }, - { .name = "window-status-bell-bg", + { .name = "window-status-activity-bg", .type = OPTIONS_TABLE_COLOUR, .default_num = 8 }, - { .name = "window-status-bell-fg", + { .name = "window-status-activity-fg", .type = OPTIONS_TABLE_COLOUR, .default_num = 8 }, - { .name = "window-status-content-attr", + { .name = "window-status-bell-attr", .type = OPTIONS_TABLE_ATTRIBUTES, .default_num = GRID_ATTR_REVERSE }, - { .name = "window-status-content-bg", + { .name = "window-status-bell-bg", .type = OPTIONS_TABLE_COLOUR, .default_num = 8 }, - { .name = "window-status-content-fg", + { .name = "window-status-bell-fg", .type = OPTIONS_TABLE_COLOUR, .default_num = 8 }, - { .name = "window-status-activity-attr", + { .name = "window-status-content-attr", .type = OPTIONS_TABLE_ATTRIBUTES, .default_num = GRID_ATTR_REVERSE }, - { .name = "window-status-activity-bg", + { .name = "window-status-content-bg", .type = OPTIONS_TABLE_COLOUR, .default_num = 8 }, - { .name = "window-status-activity-fg", + { .name = "window-status-content-fg", .type = OPTIONS_TABLE_COLOUR, .default_num = 8 }, -- 1.7.6.5 -- Try before you buy = See our experts in ac
Re: Permission error when getting cwd
On Mon, Feb 06, 2012 at 09:16:47 +, Nicholas Marriott wrote: > I'm pretty sure that should be "root != NULL" ;-). Oops, yes. I had originally had it down after the complete_path label and returning (s->cwd) itself, but falling through seems like the better option. Guess I didn't swap the compare around. --Ben -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Patch - add -F to display-message command
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Mon, Feb 06, 2012 at 06:06:04 GMT, George Nachman wrote: > As we discussed earlier, this patch adds -F format to display-message. > If -F is passed then that format is used in preference to the > 'message' argument. I have this independently here as well. One thing that is missing is a format_client call. In addition, I moved format_session and format_client into status_replace itself so that every status message gets those replacements at a minimum. This leaves cmd_display_message_exec with just a format_winlink and format_window_pane call. - --Ben -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBCgAGBQJPMI+BAAoJEKaxavVX4C1XwLgQAJs7hmU1nGJYxGqUeaN4LJvC 0n1fCNQ8f0m33KnGLpT8nvCcYeGXSL4Y5mr8NxawCYmL+ZiUWe8kz5C0bG1MiyY2 QVjAmNlh49YeFx0dfGDBo5rqdLTs6S7ioKQI+cxNrCmIs9KffkNin5dXC2iWRC2y NFNY4eqGmqQDBi7q0IeVHWs1MtZ1RwrphD+8BoX78np/XeOzSPDaTeXTpzHlIHou JrXrpDu7UHV1JyOFQRh1grE+YeNU3a9AM6YbUVHRK6iDig8DZZsI8c79DxjSRbbx 99u/qOR4DMxFvEaJLK++VemD/XK9z/2mGvJExdj23C6s60dWK+Po0FI6Uoe7vcdZ 6VV6S+B+zveYH9DlpUAAYzgR5CmvETQRaVjiszsgbLs/CBpbtheQB2dMxzSaC8Vv KbcVSXSK1Inaja219k9jOUum+0dTCtKAUQULnKyYdXXAWLkG9+iPY8Kd4djrxZ9X wfkPFAVkwxRfmRkXprgOx8zrbkn38l+s61sL0C/P3n2LYi0UwF1kZjVFi6pS6iHN /+CEfvf65GKauowq5yO/NadDhq4e83+JXMKwr8yZoQQsJxd0lVr+O/mp4xmDkop3 0wEDWTWlZHFsqXgmAMkob8pyoqP8KfXONGZcLcmHiewwVHpTdM/378OHistvRjWL +CJLyp+I9KcVCKxcmeiX =tbzX -END PGP SIGNATURE- -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Fix up memory leaks in display-message- F
Hi, Attached is a patch which cleans up memory in display-message when using a format. It also puts the message back through status_replace for the strftime expansion (reduce duplication of code and such). In addition, status_replace has its own format_tree which expands session and client information. --Ben diff --git a/cmd-display-message.c b/cmd-display-message.c index 1b87e77..f8b69d0 100644 --- a/cmd-display-message.c +++ b/cmd-display-message.c @@ -49,8 +49,7 @@ cmd_display_message_exec(struct cmd *self, struct cmd_ctx *ctx) const char *template; char*msg; struct format_tree *ft; - char out[BUFSIZ]; - time_t t; + char*line; if ((c = cmd_find_client(ctx, args_get(args, 'c'))) == NULL) return (-1); @@ -77,19 +76,18 @@ cmd_display_message_exec(struct cmd *self, struct cmd_ctx *ctx) template = "[#S] #I:#W, current pane #P - (%H:%M %d-%b-%y)"; ft = format_create(); - format_client(ft, c); - format_session(ft, s); format_winlink(ft, s, wl); format_window_pane(ft, wp); - t = time(NULL); - strftime(out, sizeof out, template, localtime(&t)); + line = format_expand(ft, template); + msg = status_replace(c, s, wl, wp, line, time(NULL), 0); - msg = format_expand(ft, out); if (args_has(self->args, 'p')) ctx->print(ctx, "%s", msg); else status_message_set(c, "%s", msg); + xfree(line); + format_free(ft); xfree(msg); return (0); diff --git a/status.c b/status.c index 4df6745..6d48fe8 100644 --- a/status.c +++ b/status.c @@ -503,9 +503,10 @@ char * status_replace(struct client *c, struct session *s, struct winlink *wl, struct window_pane *wp, const char *fmt, time_t t, int jobsflag) { - static char out[BUFSIZ]; - charin[BUFSIZ], ch, *iptr, *optr; - size_t len; + static char out[BUFSIZ]; + char in[BUFSIZ], ch, *iptr, *optr, *line; + size_t len; + struct format_tree *ft; len = strftime(in, sizeof in, fmt, localtime(&t)); in[len] = '\0'; @@ -527,7 +528,15 @@ status_replace(struct client *c, struct session *s, struct winlink *wl, } *optr = '\0'; - return (xstrdup(out)); + ft = format_create(); + format_session(ft, s); + format_client(ft, c); + + line = format_expand(ft, out); + + format_free(ft); + + return line; } /* Figure out job name and get its result, starting it off if necessary. */ -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Add line-insert commands
Hi, Attached is a patch which adds 'A' and 'I' bindings when editing the status line. Not sure of any emacs equivalents. --Ben diff --git a/mode-key.c b/mode-key.c index f1df0a4..b82e9b9 100644 --- a/mode-key.c +++ b/mode-key.c @@ -35,8 +35,9 @@ * * vi command mode is handled by having a mode flag in the struct which allows * two sets of bindings to be swapped between. A couple of editing commands - * (MODEKEYEDIT_SWITCHMODE and MODEKEYEDIT_SWITCHMODEAPPEND) are special-cased - * to do this. + * (MODEKEYEDIT_SWITCHMODE, MODEKEYEDIT_SWITCHMODEAPPEND, + * MODEKEYEDIT_SWITCHMODEAPPENDLINE, and MODEKEYEDIT_SWITCHMODEBEGINLINE) + * are special-cased to do this. */ /* Edit keys command strings. */ @@ -64,6 +65,8 @@ const struct mode_key_cmdstr mode_key_cmdstr_edit[] = { { MODEKEYEDIT_STARTOFLINE, "start-of-line" }, { MODEKEYEDIT_SWITCHMODE, "switch-mode" }, { MODEKEYEDIT_SWITCHMODEAPPEND, "switch-mode-append" }, + { MODEKEYEDIT_SWITCHMODEAPPENDLINE, "switch-mode-append-line" }, + { MODEKEYEDIT_SWITCHMODEBEGINLINE, "switch-mode-begin-line" }, { MODEKEYEDIT_TRANSPOSECHARS, "transpose-chars" }, { 0, NULL } @@ -151,9 +154,11 @@ const struct mode_key_entry mode_key_vi_edit[] = { { '$', 1, MODEKEYEDIT_ENDOFLINE }, { '0', 1, MODEKEYEDIT_STARTOFLINE }, + { 'A', 1, MODEKEYEDIT_SWITCHMODEAPPENDLINE }, { 'B', 1, MODEKEYEDIT_PREVIOUSSPACE }, { 'D', 1, MODEKEYEDIT_DELETETOENDOFLINE }, { 'E', 1, MODEKEYEDIT_NEXTSPACEEND }, + { 'I', 1, MODEKEYEDIT_SWITCHMODEBEGINLINE }, { 'W', 1, MODEKEYEDIT_NEXTSPACE }, { 'X', 1, MODEKEYEDIT_BACKSPACE }, { '\003' /* C-c */, 1, MODEKEYEDIT_CANCEL }, @@ -496,6 +501,8 @@ mode_key_lookup(struct mode_key_data *mdata, int key) switch (mbind->cmd) { case MODEKEYEDIT_SWITCHMODE: case MODEKEYEDIT_SWITCHMODEAPPEND: + case MODEKEYEDIT_SWITCHMODEAPPENDLINE: + case MODEKEYEDIT_SWITCHMODEBEGINLINE: mdata->mode = 1 - mdata->mode; /* FALLTHROUGH */ default: diff --git a/status.c b/status.c index 4df6745..e0cb48d 100644 --- a/status.c +++ b/status.c @@ -1038,12 +1038,18 @@ status_prompt_key(struct client *c, int key) c->flags |= CLIENT_STATUS; } break; + case MODEKEYEDIT_SWITCHMODEBEGINLINE: + c->flags |= CLIENT_STATUS; + /* FALLTHROUGH */ case MODEKEYEDIT_STARTOFLINE: if (c->prompt_index != 0) { c->prompt_index = 0; c->flags |= CLIENT_STATUS; } break; + case MODEKEYEDIT_SWITCHMODEAPPENDLINE: + c->flags |= CLIENT_STATUS; + /* FALLTHROUGH */ case MODEKEYEDIT_ENDOFLINE: if (c->prompt_index != size) { c->prompt_index = size; diff --git a/tmux.h b/tmux.h index 4a24e88..1479185 100644 --- a/tmux.h +++ b/tmux.h @@ -453,6 +453,8 @@ enum mode_key_cmd { MODEKEYEDIT_STARTOFLINE, MODEKEYEDIT_SWITCHMODE, MODEKEYEDIT_SWITCHMODEAPPEND, + MODEKEYEDIT_SWITCHMODEAPPENDLINE, + MODEKEYEDIT_SWITCHMODEBEGINLINE, MODEKEYEDIT_TRANSPOSECHARS, /* Menu (choice) keys. */ -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Patch - add -F argument to new-window
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Sun, Mar 04, 2012 at 03:01:51 GMT, George Nachman wrote: > Thanks for committing the previous patch. Here is a patch that adds a -F > format arg to new-window that can be used in conjunction with -P. Note that > it doesn't support any of the window pane format strings because it doesn't > seem to make sense in this context. > + ft = format_create(); > + if (c != NULL) > +format_client(ft, c); > + format_session(ft, s); > + format_winlink(ft, s, wl); > + ctx->print(ctx, "%s", format_expand(ft, template)); Missing a format_free(ft) call. - --Ben -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCgAGBQJPUvpVAAoJEKaxavVX4C1XurMP/2Nw8r6qTYGrF+leVZOi5TAV TzspSjBRaD1HbOOgWOXD5XUeUr1vmRULUrXasDElmq+h60r5RSn7DqI8uMTgVI9P oM+ujF6UtkuO9wYz1YCQ1RheGlnvUVfej/Irf0zVra61moyvpYs0JAhA4N+1TZ2L 5Bq0fEnzDI5U63AUUsCUq1yA+jq4gZNOjwxyFP1IUVvZQz5GvvhmXL5lGAMdPyfb sCv8+RpN4HW0bvbaKpmXfBqWaREAKRFiDO2Y0cus+N0nmSKjNglfG5YVmDuV0G/Q XXmbK3mb1M3NH3Jiw21UWrCfBX8tejqG0+6uJ7DazYy8IHfm9i1B28FKGA1L4SS9 bs3sIwkuy3Gf2bcZeUZ5uhgHzRWVrAvNQPOoABN2XVZ3ouerq9xfdwp393JEfYFw xJeJM1khYq7P1aOiNFXamIJW77Raa1geCjZu4/ghaEVv+/Nn7vtExasu4Fj/7b7o Rx0gsr2OIAdbvg8O5RYkT4pylsEW6hwOK7vg2RJz1/2DH0XprU5eiU8sFTNGKLE0 qgDLJzDaWtXeCz9SiXZ5d3op4tdir0SFuoXK2g9DavYzFcslvJPszDdpFNmELHml 52daYKBwGq6LlyXHRtCXeyCpHuFsCgGxZp9beOVtV53ihbimk4Bbh8qcT/MaFyhl JhUQJvi9umAwpXvYmFaq =67XL -END PGP SIGNATURE- -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Fix up memory leaks in display-message- F
On Sun, Mar 04, 2012 at 07:34:33 +, Nicholas Marriott wrote: > I want to be reducing the use of status_replace so I don't want to add > it back to display-message. > > It is a good idea to use format_* inside status_replace, but first it > needs to be changed to support the length modifiers. Then it can replace > most of status_replace1. I haven't done this yet because I haven't > really decided what to do with jobs. Alright. Should status_replace get a deprecated attribute to help draw attention to where it is used? Attached is a patch which just frees up leaked memory then. --Ben From 240815ea175b421f16113d63ef2eb57549aa7475 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 4 Mar 2012 10:25:28 -0500 Subject: [PATCH 1/2] Free the format tree --- cmd-display-message.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/cmd-display-message.c b/cmd-display-message.c index 1b87e77..dd1a955 100644 --- a/cmd-display-message.c +++ b/cmd-display-message.c @@ -90,6 +90,7 @@ cmd_display_message_exec(struct cmd *self, struct cmd_ctx *ctx) ctx->print(ctx, "%s", msg); else status_message_set(c, "%s", msg); + format_free(ft); xfree(msg); return (0); -- 1.7.9.1 pgpPMld0yGjtZ.pgp Description: PGP signature -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Merging panes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Thu, Mar 15, 2012 at 07:18:04 GMT, Nicholas Marriott wrote: > tmux selectl > '9d50,126x23,0,0[126x11,0,0{63x11,0,0[63x5,0,0,63x5,0,6],62x11,64,0},126x11,0,12{63x11,0,12,62x11,64,12}]' > > Or you can usually get whatever you want by selecting one of the > predefined layouts with ctrl-space and swapping or moving stuff arounf. Hmm...would it be possible to save custom layouts given the above string under a name? Probably using percentages instead of hard coded numbers. This would also likely make the current built-in layouts much simpler. Also, is there documentation on how to create a string like above without making one and then printing it out? - --Ben -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCgAGBQJPYqcrAAoJEKaxavVX4C1X3yYQAKZ2DrLw2y0J+wjPaHFjfkDt FLnh85fhGZK6PBo0HXPodKct93yDfmDUWftVIYfKc17ZcYVMnztf5xZeBbhb+wgQ HpJFtUsPsVolBh+E4Bi2Bzncjt7Nei/59KNZGZTjYplNJJeTmI/aG8yXdn2HRVGG kun8ERjT9QIvKqE75eHTl/d/Wzy6jnrviO3AgsulSyOIYCS7B/0bVkFQRWHvVWrS wfgpvclaOFtuR616VocubTOWQJvJiMY9LACMmXKxcBcW3ky3KD/YyK6aWnhIJC+Q LxFWyVqX1WglJAb4i1F/Y861k2mxtWBugP5XpFeDkXjDRI28ptC1WqwhrdMf2o27 2nuR4pqFLUCF+cSzpdtXfGHeur+4TBAwGRILRMF4eq0B6sUJfsIfroFYHvpjeuCC Ibe47MWQrwD5VTVih0gJpQUfUJvVVyfHszAgWoE2LIcHqbMACAtPVGKocGEpoo3W f38XODuAeh6tWn9kECb5JcA7v4QXG4hlko9irL02A9jlSEw34pVYgpJ0br/jdzzP L+/oN7bRHqBXgSAyirNjo3a2P7xn3kXX6igDZgb6TK+dhoc2UfzMuKPn/4pkvrrg rwHDgXjgRtx16VmflBi5vGrfBpBR/UWSIyXDbmLud7drNs37Wrd1j89wp8jJTWey dEl52XNIc2bFguBDr0sp =ub+e -END PGP SIGNATURE- -- This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Add XAUTHORITY to default for update-environment
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Thu, Mar 15, 2012 at 19:42:44 GMT, Stroller wrote: > You know, there probably is a case for DBus, at least. I don't know > about this stuff, but I know that I'm generally the exception. But > you're going about it in a very bad way to make your point. I agree. > I would have thought that amongst tmux users there were fewer people > who needed DBus than in the wider Ubuntu-using population. It's nice for things such as upower and udisks so that I don't need to login as root to do things such as suspend or mounting USB sticks (technically, I currently use autofs for USB sticks and the like, but I need to either use root to umount or wait for the timeout to get them unmounted). So a system bus makes sense in many cases. It would be nice to be able to use the local DBus session bus when ssh'ing around, but until ssh forwards DBus session buses across the pipe, I don't think tmux would have much reason to deal with it. Hopefully whatever solutions for networking crop up with Wayland will automatically forward whatever is necessary across the pipe instead of leaving ssh pick up all the envvars IPC and such may need in the future[1]. As for fixing your issue for non-ssh use cases, I'd recommend running "eval $( dbus-launch )" within xinitrc so that the entire session is using one session bus. For one-off uses (typically KDE and GNOME apps), I just do dbus-launch within one window and leave it around as needed and then kill all dbus related things later. > My problem with starting X11 apps from within tmux is that I get a > screenful of shite - diagnostic output about GTK libraries being > accessed and stuff. So I just don't tend to do it, but use a separate > window on an otherwise-empty virtual desktop -I run `ssh host -X > firefox` then ignore that terminal window completely. I'd love it if > you'd help me use tmux more effectively, though. I don't have that issue... Starting things from tmux Just Works in pretty much all cases (except after attaching to a session over ssh which either clears DISPLAY or makes it point remotely, but that's not easily solvable). - --Ben [1]From discussion on LWN, it'd be nice if Qt/GTK took care of network transparency because then they could have things like DBus use the *local* bus instead of the remote one. They could also expose URI schemes such as wayland-local:/ or wayland-remote:/ to access the local FS as well as the remote one. I firmly believe that the "it *looks* local, but it really exists remotely" solution is not the best that we can do. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCgAGBQJPYqYCAAoJEKaxavVX4C1XQPEQAJhuATPopJ6AzXMzWokhdarc hACJMXa0KDJKNOQgN0Moh4kWSjOVI6H2gsDPvukdnlU3ashxe598nUJV1cujxBkc eKRcy8DUlBQdGAFd1/hD5lHeXhnlTctxAbf41Q2YVUNu/6utijqj4RzZcqo+npTE pdgKt6J6S0LOLHr9dQfc+4vnufQMNF9tMt9HbgTEwKk6YncXeq7PtaPh7NdZIS61 6oeGl7hOhQ+9zzpsdmKbhI/Qxtw3SdJJWuGkEyM9TVLzrCfhtSG3Ch2xHm5ffn4u KpWwEInKE+D9HmLSczGKFkUSvcFetCctvxm2sWYTfvfHSOBPeL6N4p1qCgoF2KDy XHh/mD0epT40CudB2d6oMczfI6kXpdmohDSYU6sGJgNOKVira1+S5QDBoaTV4xTz Y28e6UiBJH8BV7X0EzuC387Jgy6Sd7t284zhnrOiIByk2i8lwW304fKZOTA5hpE5 pD8TNbgAimskuquS5P3QBr0NAOCNcKjvluRVDKozuK4ab63SBkTpSbDkyTfCrRXO r1ZFfwGy3Go0Z8ylo7x8U4qfX/AxuQVow2YXzab/BcZjlcWTvM+Ja0Yj7iU8ifUz o0EakiVVuzVR4jgbVZXQL9/DyNhTyspRTM0XRxL0FbeM49kAwqZcZcoR4MKZR3Bc gbLwGb9uCiHWCivTsW2B =z0dq -END PGP SIGNATURE- -- This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: script to zoom in and out on a pane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Wed, Mar 28, 2012 at 15:57:48 GMT, Le Wang wrote: > I made this Ruby script to pop out a pane into its own window and pop it > back: > > https://gist.github.com/2227539 Instead of using the environment, why not keep track of pane ids and window ids? I know I would prefer to keep pane titles as-is when zooming. > Is there a repository of useful user scripts where I can put this? Should tmux adopt the git model where any tmux-$cmd commands which are found if $cmd isn't a builtin get used? There could then be a contrib/ directory which gets scripts like this (though I imagine POSIX shell or perl would be preferred due to being pretty much everywhere versus ruby or python). - --Ben -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCgAGBQJPdRICAAoJEKaxavVX4C1XA64QAKZ2W9xRIh+EBBWk1Lcan978 NgExyGs6q+dahUIXO9cnviBF6jKJJLM+QXew3tNYhsZvP6dDWAIVWcpqBJYRDufR q8wTG1LMuGkFBvlHp9a3rKXTZdTUtcGMSN2kOYG9wEfpFKKIHtyGWXR7TNzQRKLJ 8LFiEJBXcTK5cJvRDcC4WiADSNFOqxRK7oh9/OY9/9sehhnYatFc2rAlV92vjdPT Z3LH0gjanMHsCahAA2uThK8v/LseSkmqTJBIYhPazAAPNWIJFsg1ZNKv8Wij9v4c nx2MS/aNObsGXdM6RNe05f6kdMBDKHkxqVL87f09ywg3H9r/0TH2mikEntkfVl04 BOl4u9z5S3BPnj9kI80hSAaIvNMPURbU/lrTiQ0L1E/nvtWKgTwOdam8dj+AjuvA vhu4cpzK7OSnpGXBJJKcqZ4UKJGT7iXfveh8pLtr83MvTFAG1Cu9TA15qANeXdYe q724mEss9kc68xpIIkD/5LgisGCK7ZTXMoGsSezS15rwxH4VXdFUQd7LWZ1QZnXV EcUuvMt/tJDKIj6pBptpNwj6gUZ5Wo9CyAPCS/ps9dgqHVQWa6JPW2uqdxEmKwOL NkJs95oUDySVbfznxDjl4jzOdIjdEUkIdvmlQ5pV/Oug5PimhlrkXdJk43tnjJS+ NCBFZe/Z2LEMhQYN4gCQ =DbfM -END PGP SIGNATURE- -- This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: auto source ~/.tmux.conf
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Sat, May 05, 2012 at 00:10:50 GMT, Alex Yelluas wrote: > Is there a way to have tmux source ~/.tmux.conf file automatically, every > time it's invoked? Maybe a wrapper script in ~/bin or somewhere else? Though this does give me an idea that it might be useful such as on-attach bindings (basically events that can trigger handlers, possibly with arguments). > Also, can it be called ~/.tmux (without the .conf) like all other ~/. files > ? I don't know how much that really gains anyone. While we're at it though, other potential names: - ~/.tmuxrc (which matches more dotfiles from looking at my ~) - ~/.config/tmux/config (XDG directories) I'll keep my paintbrush dry for now. - --Ben -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCgAGBQJPpH9QAAoJEKaxavVX4C1X6DsP/j93/XmNZ6KnbvhbH6SeOYGf sIy8UCRyZ/71iztB5oMTXq6c+sGZhy/4YStOidXZkbaPWJsYL0cYX1R/uj816rWK +sEcwLUoWnghQYKLF3rYd1E36qbpGMU8fKcJirI/QAQg9B2iXQ/hjUBchdi11DN6 fme25wH+V6tzMJxhXuUIdr7e2jTx5P+nFo+Gdlg/DddFdhoUDgPfkc/wxDAN+AlP gOwwKBAfeE1rL6a0gjEXy9id+Pg0KkO5hqYs3d6MMRRuTTMe0d5Ir804DYRm4sOF S8yEV7uNkEQ2XHwe6LZKgypbRNUIfAvWF+awoZwRhArdeG7KM6BOWoSisTgC9sUl VsEdcRx0CEtZukO3/ZkTQsABaZ0CpJsz951mAfSSp4c4dJJchsU8Pd1Olp2Rw8FM UPYnKBeegBGKGOV+updkdsQoLJXxhZX/unS1VZIb/IpfxLUgwIXtfsevuX5no+3W /uAIfLRF4Jae4kMbeOe4BUBanAKjlLJnMe2Nk0wtiMqAzb/Sl/G7AGoD1muzhRNA 2HYXxhX+Nvkm1C1VaWwr5YyaFzXCIRV6KagjX2VwytFwXOaNjcpqpcTB2/qZns6L FVBK4HpUIeIbJpS33z5It8hNle7H85QBr3bDGTGHhW17FfuFs5cwNNiKn+uMjzNX ceqKHrPUmXhgY00pIz+p =22nc -END 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: Clickable URLs and other patterns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Sun, May 06, 2012 at 19:39:48 GMT, Ivan Necas wrote: > Hello Tmux fellows, > > One thing that was troubling me a log for a long time was when some command > produced a stack trace with file paths and lines and I had no other option > then to copy the file path and remember the number: not very smart way of > doing things. Well, I didn't know of any option until this weekend when > I've found possibilities of urxvt extensions matcher [1] that allows to > scan for some patterns in the terminal and makes it clickable to open a > link in a browser, a file in an editor etc. > > This doesn't work bad in a pure urxvt environment but in combination with > tmux there are some obstacles (like not working correctly when a link is > wrapped across multiple lines, missing access to environment of the shell > in the target pane etc. > > Therefore my question is if there is a plan to add either support for > clickable actions directly or some urxvt-like extensions system that would > make it possible through some scripts. > > [1] - http://linux.die.net/man/3/urxvtperl Maybe this would be of interest: === BEGIN === #!/bin/sh [ -z "$TMUX" ] && exit 1 tempfile="$( mktemp )" tmux capture-pane tmux save-buffer "$tempfile" tmux delete-buffer tmux new-window -n urlview "urlview $tempfile; rm $tempfile" === END === Doesn't catch scrollback though. - --Ben -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCgAGBQJPqGElAAoJEKaxavVX4C1Xvk8QAKSBXg9QPiZ+IUOtjZoGOY2u TqDRMmG0QCR+OWJXWY6Q/dxWkZhGwvMjw8fC++Lk/qxyyKpYdZQY5LqAC8KqlbSB bZQbSZvAGh9Me1IbV4ltSFxbtnzattKWD477Q2/3XWe8Qbm3SaJGHEF0d4a5c4Sq bkn1iSq1kDNPU1EEuilJdM+REKXanW23gPeH5Z6j02YQ0lInkiVVR61Zj8ZXA4ta bE9YTzlclrB+uF42BCZ8jyZv2F1cXpyMaXff2Lzgyodu7D/pZdELrsFDIhvOQ64p kMkTC/L9O5XE78eMVsxhjf6V4mUBl3inA2Bq+haF4OYSZwZsj56sIgsDevHv3dGM dvlimUBODnM8LXrENZ4zVwaNSzHFfjCJoG79+fPGqPRoA1PA7f3XjNMIjGdDjXgr /Ld+xwTwbs6Q7CbLSKq+YQTR9O+yk+fk7ifXzC0+VNPRGUwZ17GOfcsNwJuveufF qU1SjnpUeVtR0+aNy3u1/xcfOLG4r2JqZ5zpiawkwTs1ylYfQKH9v5Ifipdt4ZQl jPnAwTVfARaV6c6alCsj4Kx1Fa3UZTxNAoYeBFvRKmrHbXc4kZHhQuElrwemAOb0 SO9E8S59xfMMtUFk74U26rbfDgy8OWdEVXHRbiMUy9bbJwOenINrITzrRuVpnNKM J1QaFVEjzModD3F7oNwC =yUg1 -END 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: [PATCH v2 1/4] Add cmd-renumber-windows definition
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Tue, Apr 24, 2012 at 22:07:40 GMT, Thomas Adam wrote: > diff --git a/trunk/cmd-move-window.c b/trunk/cmd-move-window.c > index 5c4dbbe..acb5044 100644 > --- a/trunk/cmd-move-window.c > +++ b/trunk/cmd-move-window.c > @@ -42,11 +42,22 @@ int > cmd_move_window_exec(struct cmd *self, struct cmd_ctx *ctx) > { > struct args *args = self->args; > - struct session *src, *dst; > + struct session *src, *dst, *s; > struct winlink *wl; > char*cause; > int idx, kflag, dflag; > > + if ((s = ctx->curclient->session) == NULL) > + return (-1); > + > + if (args_has(args, 'r')) > + { > + session_renumber_windows(s); > + recalculate_sizes(); > + > + return (0); > + } > + > if ((wl = cmd_find_window(ctx, args_get(args, 's'), &src)) == NULL) > return (-1); > if ((idx = cmd_find_index(ctx, args_get(args, 't'), &dst)) == -2) This breaks external tmux controlling with move-window altogether. There's no curclient outside of tmux itself. Should -s be taken into account as a session when -r is around? - --Ben -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCgAGBQJPqGUFAAoJEKaxavVX4C1X9poP/2Np6fhh43AwK3dfahsmusNn nQCSgXuV80mcgRlWnLP713zSrJVq3cv0NK0tUNExmHquZXLirOhvqcaQztIA9bdv 9WUOaX7sz0SYM7qTi/M4oAVjrM8Bvfn9xS8oKLXtAPug/ofFKRW3/YXw7VlN1tTM MLGv0M/D4eOBBzurXTlb5NJ+N4ZpCnj9oH91FUuuq1ZQ4XwYQLlcm9LjK8H02u1O g5MYX+wT0sCT2O0DA+dCy7zd+PIvXNo+SPIvcf3AUymNu+QEOb4QLPPG9yMX9ued FxrllnYuB46tgN/MrGIc1+YMa3encRvev1znUjUTAcPIxeKZUzIRq2ceu80hWEp7 SzDBTeqqXMCyqBc1gKUWhYbK6qrOd+W2PogD6xpQlk0VyEEku/ZJsGSX7tBpOWzl igWxSvhFGahbdjoZN54G1wCDiIqX/m5XriCqjgkjB8wQh3uPMxZ5TopjqBz3ns8u TDMT0P/3NTHSsntXUtBTf3o7FZWkLMLWFE9rA1UEkoMdTQjPhzTN6OouxbhE28QB ispnlajK96gCanh+e2iDXtVC7nfYnlYN7Xr5SAI66yRIUW28tWroNKadCSM0RI/z fnogYQS3TjjfdvjF4+XhNFaYI+/a1wOFlOsmRW+LhxfZMh0rAKtUvf1IL6dI5W1R Nnpo75VXYPERQFJ0mC4p =afgI -END 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: [PATCH v2 1/4] Add cmd-renumber-windows definition
On Tue, May 08, 2012 at 11:04:36 +0100, Thomas Adam wrote: > On 8 May 2012 10:04, Thomas Adam wrote: > > So I am not sure how best do this, other than have -r take a parameter to > > specify a session, and use cmd_find_session() to look it up. > > Something like the following? Completely and utterly untested. It's pretty much what I have which just uses s instead of r in cmd_find_session. > diff --git a/trunk/cmd-move-window.c b/trunk/cmd-move-window.c > index acb5044..6b17b82 100644 > --- a/trunk/cmd-move-window.c > +++ b/trunk/cmd-move-window.c > @@ -30,7 +30,7 @@ int cmd_move_window_exec(struct cmd *, struct cmd_ctx *); > > const struct cmd_entry cmd_move_window_entry = { > "move-window", "movew", > - "dkrs:t:", 0, 0, > + "dkr:s:t:", 0, 0, > "[-dkr] " CMD_SRCDST_WINDOW_USAGE, > 0, > NULL, - "[-dkr] " CMD_SRCDST_WINDOW_USAGE, + "[-dk] [-r target-session] " CMD_SRCDST_WINDOW_USAGE, Maybe? --Ben pgpyYiJ6S2Wxv.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: [PATCH v2 1/4] Add cmd-renumber-windows definition
On Fri, May 11, 2012 at 09:12:09 +0100, Thomas Adam wrote: > Hi, > > On 10 May 2012 07:02, Nicholas Marriott wrote: > > Whoops, I missed this. I think it should use -t like everything else: > > That looks OK, but as I mentioned before, the semantics for -s change > when used with -r, in that when using -s, we're not looking up a > src-window, but a src-session. I am not sure how you plan to reflect > that in the man page, if at all. Well, to be fair, the semantics of the entire command is different when used with -r since if -r is there, all of the other flags are ignored (silently). The -r flag might be more interesting if it happens after moving the windows so the windows get renamed in the source and destination sessions. This would also likely need a separate renumber-session command or something. --Ben pgpROLgq6Koos.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: [PATCH 0/6] Convert choose-* cmds to use formats
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Tue, May 15, 2012 at 22:59:41 GMT, Thomas Adam wrote: > These six patches teach the choose-* commands to use -F for the format > option. In doing this, I've also touched on the existing list-* commands > because both of them used the same default templates. I'm a fan. There are some nits in general. A macro for format string usage help similar to target client/session/window/pane is likely in order now. Also, the flags aren't sorted in the getopt strings (there are some other places where this is the case, but I can get that patch in after if the patches aren't worth modifying before they get committed). > These patches are a precursor to a larger set of patches for choose-tree, > but I wanted to get these out the way first, as they're useful. Sounds fun :) . Can't wait. - --Ben -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCgAGBQJPsukqAAoJEKaxavVX4C1XysQP/08GdepVG5E/+vGZRGOVswOX M6YLS8fLVwAZuPKqqwxyzlMlXBRLADImmyif5uzQ8ArKI4MC6AyO3tDDV9VD3Yhr 8pCqOTBrxsm6gk74rhIx+qqq/mrtVFOz58cZzGLK6ReRIJwy3/6SnrkX0c330tjf PMM6RLjn5UlEXFZEnw36mG016+t4I6oCIdTr7psxFmJWssukMJngnRKoB33J48aA iQXprxSrzmKeXhzE3opVUPbAB/eeJHusq9sQ+efZGAvGu90vFreegwDnNiYoblM6 riSN9lUfHWaju6f0MuqDiyfnU4b3WXMctvZrKCbJIiH6jxau9c2ca0WRBlZ1ui1j 13WGDKf//AUsGltem7EnaJN8wUViZhs1/+8d3+/aTJgZfCPnZHlXDQLQ4xQk2yrx 9xpIbp8VCH+AXvvcFK2vlVwM9nRkjipVhv0bNm4fpva/tBO2nPt9iGMecLNIAvQk 2LK7npEKnfvfiKx0Rksxwd9dz1Fw7oXzTAWGpS0hKaqtOoMS2lc4TAxzj5d5iCOa 3hRL/k+ATDkF4ggygG5oudzH4VWvnpVlQN/tu3B56BgfqinxVIArWzPf7A/pZJiS 1VUN0dESD2pJAGNHcpulLqStiqTW7VMZyhAPvBDYKhZfw+HSZz7lU9b+IsT9eb3l NLJFFLTKOgHMaAc1gtHT =7AzO -END 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: [PATCH 4/6] Teach {choose,list}-sessions to use formats
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Tue, May 15, 2012 at 22:59:45 GMT, Thomas Adam wrote: > diff --git a/trunk/cmd-choose-session.c b/trunk/cmd-choose-session.c > index d3e5354..ff8ce99 100644 > --- a/trunk/cmd-choose-session.c > +++ b/trunk/cmd-choose-session.c > @@ -34,7 +34,7 @@ voidcmd_choose_session_free(void *); > const struct cmd_entry cmd_choose_session_entry = { > "choose-session", NULL, > "t:", 0, 1, > - CMD_TARGET_WINDOW_USAGE " [template]", > + CMD_TARGET_WINDOW_USAGE " [-F format] [template]", Missing F: in the getopt string. - --Ben -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCgAGBQJPsuhdAAoJEKaxavVX4C1X4vUQAMxvj3gXaPt92zooD4KRbppr kf0QxfrGEA0nBz58JT1UsxISG4LbmXsg0UNpfVi+lpApQMFeIBZBQXis79Z4PboT iJHZ457YJge2M/224WtWI1oT4FXFn20Wh+BH2vmGQ5ftbc2eXB8Y91DcqacxVyUT NWBwUOZObmZ53OqNmHhgEkTkOnweWkWUsJ+ZOlFNzi7fqg5wDNI/0wXGzB8v4X3d KqAUXAYdxvdFgjLEAD98vGxRctajV0xnb+RWOKS5tC5nB1QSNVm9KB1BHZ9/Wfso HlYoZPYhFPMYcACCiPiM5GanwnVBR3izW+NqOy1RUbyTyNhDkhlbb9bAZzlvmb9S WTmRYXQjbBQHZzIB2IMKoOidenzZzTBdgTsnl52KA/D091qLZ3o0hYr1U/hRtdAX 1pv31d3RVKB5oHHAaL6j9m0dAeHACcXmdbKuh53GZPp00cvAyedsAXnIFq0yLF3n Uh1RYLdA00Oy8wmD2YDXwrKp64kO4K73l8RkTa7BXZ7I5jX7CSmvr4yxBTuCsm1w 2wZ0pINT/ejYMtibP7O6L55xZVdwwwoomi95ybYmWzFeM5t/C3KCmODf+MB1/sAv PrBKhR2hZiUK65TUoOjKTNVU5Ql14QF09WXiqwQ+QDTf41Fb8GG2Q0EFk7IQqS4S YmYCZ734ithCrY9takjJ =2t3N -END 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: [PATCH 0/6] Convert choose-* cmds to use formats
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Sat, May 19, 2012 at 06:22:16 GMT, Thomas Adam wrote: >> There are some nits in general. A macro for format string usage help >> similar to target client/session/window/pane is likely in order now > > This is difficult to do, not least of which because the format machinery > doesn't care if a certain option cannot be interpolated because not all > commands have access to all placeholders. Fixing this is not worth it. I mean the "[-F format]" help string should be macro-ized similar to the CMD_TARGET_WINDOW_USAGE macro. CMD_FORMAT_USAGE sounds good to me. >> Also, the flags aren't sorted in the getopt strings (there are some >> other places where this is the case, but I can get that patch in after >> if the patches aren't worth modifying before they get committed). > > Well, I don't care as much but I'll keep them in order as much as I can? > But I don't want these patches ballooning more than necessary. It's really up to NicM whether the patch would be worth it. - --Ben -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCgAGBQJPt8DcAAoJEKaxavVX4C1XdX4P/0DUWl/QJNp5gkQaz0pWmk+g Jtb2om428ugn1ZSyu39OAlMNbbjvKpSfNhgii8PtPA5X6gZpyf9LVJPbRmHBfLCc bMRNquyQXFcXLYaGzc1cIDgP1FAurA2FQW4dXgj8y7Tcx4WP1we/4652TsZpoFNf YB+NcU1r/FDnu6C6UVj/uDGIJCQkKdpRpb4ZYPLX/lxxTXB/p3bv97wQtV0hJK36 f8f8+BQOvuS/wEwcixuFv2cmwMxzh7X9VsGUAZVgeUxPZugKeEtZBxNCR8DviD3f FAIPxra10Ph3g6/XK9gxeNvWm0K2S2ExN/P1i+s9q6WVH/y2N1isDHC/E8WXLFA9 XxlWAiB1WnOlCZ56dlYB2R3R4jyBXOZHNddXtSV1xBC/73TZUpGOYNAFW9Ppon7s bHQYsqaS9zxL87AN2lXxQb2Sf9rcJb/lmhR5v4kCpsR1XjMuEVB47WvuW3syp0iT eR3Us6CKJruXp9MyiSzHKBkShvYwcKeJRnJcYabdC39cqhwT7WgqtERQGrVPnZtM UyPzRHWWz9nSVl5JlGrJAOC9dJiRyhhG/KpKUwnBgfNhRe9JItJBNOjiKeLx1S7G RIzvMYRpN0O5w+/vkQ6sRxAl1Wy7yj0cc1xpFftHeBcrXaFBiNMaHQ5E6/0V4I6a FXcaA+Bbb6I67T0tk12y =XYW3 -END 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
Movement when block selecting is weird
Hi, When making a block selection, it appears as though the x position is not properly remembered when '$' is used. Example: a line a longer line last line Previous behavior (caps is selection; _ for blanks): Start: A line a longer line last line Down + $: A LINE A LONGER LINE_ last line Down: A LINE A LONGER LINE_ LAST LINE_ Current behavior: Start: A line a longer line last line Down + $: A LINE A LONGER LINE_ last line Down: A line A longer line Last line It appears as if it should work based on cursor placement when moving around after using '$', but it's likely that something just isn't quite hooked up right. There is other weird behavior when block selecting to the left and then using '$', but it is likely caused by the same thing. --Ben -- 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: PATCH: cmd-paste-buffer - synchronize-panes fix
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Sat, May 26, 2012 at 06:13:51 GMT, Nicholas Marriott wrote: > Hmm. I'm not sure about this - no other commands are affected by > synchronize-panes (not even send-keys). I kind of like that paste > doesn't work, it's useful to be able to send something to a one pane > without turning the option off. Maybe a flag to the command(s) that care to look at synchronize-panes so that the functionality exists. If not, maybe a foreach-{window,session,pane} set of commands would be nice. In fact, the foreach-* stuff is probably more useful in general (set-option, set-environment, etc.), so that might be the Right Thing here. - --Ben -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCgAGBQJPwPf1AAoJEKaxavVX4C1X5fEQAIlD+ZwPsyjx+1rO5FvEpMbH KstChez2aRbUQqoxP39oSL1HcdhEge3NiX4MhE7NMoqCKMBdV8rWJ51WBxCg+Ywr S2M9CvUt9ueHRPfwL4uCF3Wha8A1RgApPIg9bKZuykmadir4QKYzoH/Xe/3uLhgm QydmpOWvZL0X18LVoWXY94CZYU/LrxSkiU/rrRWeknDxx2CP4dTzfqlRvcsmHDDy txt9RjeKNYmtuB4FRdbzCG4sypcdyUVEnJ03hMLRSuLVdmAzCCcA6C/pFsNiDhHJ v58RAUPBBJsyHV0n42eHO1cKyEBDh5YjakUP+qUy9486CX7rFPJ8+tPhz4muTKhP uXcHGI9YbHWe4eV6Sw8Uced8eJFfXL3o4Czlj4wYstMpkB+j8VcfshOSxW6pLiiX LJKs2Id3R2vH8y4qF3O1T9O6VpTAojqoUz6idmJUmM8oy/LlrNLzAujkIrz6mXds EMFfG9kT+AY1Vt1XJpz7/F1hyYZnibgBExXXQRMtd7Lw1s3DadHdLifMote9W6Ki o4NrFb+JpiTU5fH/8J1TJ4vC1Dm+Mp3LM90C6CkdRmjT5EQvE9tlykSubE90LwqL TXknRTGEsX+PRdOgHgE9RgYaWIiEquoW7eQ6Hd0h8BzeLw6ephlNY968BKzr39RG dCxIggqLX7T2e4gEpVeQ =sFLS -END 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: [PATCH 1/2] Add the choose-tree command
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Wed, Jun 27, 2012 at 14:20:13 GMT, Thomas Adam wrote: > + "[-S] [-W] [-s format] [-w format ] [-b session template] " \ Extra space after -w argument. I don't see any other issues. - --Ben -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCgAGBQJP76yCAAoJEKaxavVX4C1XfcQP/Rfp10QuK+vZsmU55Xs6Nf3B CF53qw7D5BTsITI8wNPaxwBsVVl3BbeqjEozxi4ROos26DlKNpfyvqJ5aP4BJOL3 27x7MlS0Hh6E12LDTsErh61Hh/TXoJHHy+Cco5WtnpRasl+ktczbjNNrx+ROFH41 qTYhJ0mx/rtp6RI5t2KbpmvB15VuE+fKZCF+RvOMjQ46khMzUVu/b17cVi+efSxD 5QdIBR7lA5GcLsarP6NFE24RxKNOUFE4xdhnmyYYfRE0nyF44AYtvt/raARLn6uo OnE5ZveaMSZoj37UJ4gU4QHdOP16ScRhC1WPbSUdf+AZmxMW24WLg8PXlkEm2HGB hkpRgT2p51PA9Akbznl5IfzY0TgUiVF6BLUoLDc1vY7z9PVNXx+cncWyQy7l0BPb Rp69qNPqQGSBkWdSfpZWHb2tqTpCZsVU57ReKoVEXPvYzaGep9lQCGHsnmA5iERB GQpb+nZoR7ECBV6YA2HSMOOFsPSTdHdPINGSI6mATvdPJQKSZXMFl5M1OLL2nUX0 sPV7B9hTIKYLKQIJifbOD0+E/AtYLhssdBCxS/bO3p7zX3Bz+wFv5eSqxKXOQWuy CDGvXdJr+s/EsjjtnvfNLImcjAOLX1wcAkdDm/fDWcb3EeSvupLTwpvWW2pvI3HC uCg6HRQkn/9eRH2TQshU =sTFp -END 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
multiple modifier keys in bindings
Hi, Is it possible to use multiple modifier keys in tmux bindings? i.e. rather than just M-right for alt+right, something like MS-right for alt+shift+right. I've read the man pages and it doesn't seem like it's possible, but, I may be missing something. - Ben -- 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: Make tmux honor XDG_CONFIG_HOME if it is set.
On Mon, Oct 15, 2012 at 08:59:57 GMT, Thomas Adam wrote: > On 15 October 2012 00:37, Nate Soares wrote: >> Hey all. The attached patch makes tmux honor XDG_CONFIG_HOME if it is set. >> This is a nice way to prevent the pollution of the home directory. > > It's also quite Linux specific, and hence I really don't see the > benefit to this at all. Well, not really *Linux*, but more in the realm of Desktop Environments these days. I'm pretty sure KDE, GNOME, LXDE, and XFCE all use and/or support the XDG environment variables. Another possible solution is to put things in osdep files. --Ben -- WINDOWS 8 is here. Millions of people. Your app in 30 days. Visit The Windows 8 Center at Sourceforge for all your go to resources. http://windows8center.sourceforge.net/ join-generation-app-and-make-money-coding-fast/ ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Make tmux honor XDG_CONFIG_HOME if it is set.
On Mon, Oct 15, 2012 at 09:05:52 GMT, Nicholas Marriott wrote: > Not wild about this - tmux is not an X program and this doesn't seem to > have particularly wide adoption right now anyway. It's gaining support. git recently added support for looking in $XDG_CONFIG_HOME/git/config. I like using it because it means $HOME is fairly empty (.config, .local, code, and misc are my ideals, but that's a long way away). Maybe a compromise could be to use a TMUX_CONFIG environment variable? (I also would like a TMUX_TMPDIR or TMUX_SOCKETDIR so I can have sockets in $XDG_RUNTIME_DIR/tmux instead of /tmp/tmux-$UID, but that's a separate patch). > alias tmux="tmux -f ~/.config/tmux/config" This doesn't work for non-interactive shells (such as those run from dmenu and such). --Ben -- WINDOWS 8 is here. Millions of people. Your app in 30 days. Visit The Windows 8 Center at Sourceforge for all your go to resources. http://windows8center.sourceforge.net/ join-generation-app-and-make-money-coding-fast/ ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Amalgamation of list-* and choose-* commands?
On Tue, Oct 09, 2012 at 17:21:00 GMT, Nicholas Marriott wrote: > On Wed, Oct 03, 2012 at 11:42:40PM +0100, Thomas Adam wrote: >> * If a choose-* command is called without an interactive tmux instance, >> emulate what list-* would have done. > > I like this option best, but I'm not sure it's worth it unless it makes > the code significantly simpler. If the output is a pipe, list-* behavior should be done as well I would think. --Ben -- WINDOWS 8 is here. Millions of people. Your app in 30 days. Visit The Windows 8 Center at Sourceforge for all your go to resources. http://windows8center.sourceforge.net/ join-generation-app-and-make-money-coding-fast/ ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: [PATCH 3/6] Don't exit copy-mode when scrolling with mouse-copy-mode set to "within"
On Sun, Sep 16, 2012 at 21:46:51 GMT, Marcel Partap wrote: > --- > window-copy.c |3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/window-copy.c b/window-copy.c > index ca4c97b..bd78f30 100644 > --- a/window-copy.c > +++ b/window-copy.c > @@ -836,7 +836,8 @@ window_copy_mouse( > } else if ((m->b & MOUSE_BUTTON) == MOUSE_2) { > for (i = 0; i < 5; i++) > window_copy_cursor_down(wp, 0); > - if (data->oy == 0) > + if (data->oy == 0 && > + options_get_number(&wp->window->options, > "mouse-copy-mode") == 1) Isn't '2' within? > goto reset_mode; > } > return; -- Ben -- WINDOWS 8 is here. Millions of people. Your app in 30 days. Visit The Windows 8 Center at Sourceforge for all your go to resources. http://windows8center.sourceforge.net/ join-generation-app-and-make-money-coding-fast/ ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: tmux with multiple monitors
On Thu, Nov 01, 2012 at 01:49:04 GMT, Mark Volkmann wrote: > I think the answer to my question is "no", but I thought I'd ask anyway. > > Is there a way to get a single tmux session to utilize multiple > monitors? It would be nice if the windows of a session could be > allocated to multiple actual windows so more than one could be viewed > simultaneously. I realize I can view multiple panes at the same time, > but I'd like to also view multiple windows. If I'm understanding you correctly, try the -t option to new-session. The new session will share the same window set as the -t session, but have a different viewing history (last-window), current window, etc. There's some bug that makes sessions stick around afterwards when this feature is used, but I don't remember what it is exactly or whether there's a fix available other than some ruby code that was on github (it should be linked in the archives). --Ben -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: script to maximize/restore panes
On Sat, Nov 03, 2012 at 05:15:20 GMT, Kazuhiko Sakaguchi wrote: > Hi all. > > I wrote a script to maximize and restore panes in tmux. It's similar > to the tmux-zoom. > > https://gist.github.com/3901976 > > Idea of tmux-zoom is awesome, but it has some problems. > - If title of the zoomed pane is changed, tmux-zoom can't restore the > pane correctly. > - tmux-zoom may kills a non-related window. (e.g. after rotate-window) > - tmux-zoom can zoom pane that it's already zoomed. tmux-zoom isn't using pane ids? I'd think any script not using them with newer tmux versions is bound to break at some point. --Ben -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: script to maximize/restore panes
On Wed, Nov 07, 2012 at 15:13:21 GMT, Thomas Adam wrote: > Hi, > > On Tue, Nov 06, 2012 at 03:42:58PM +0900, Kazuhiko Sakaguchi wrote: >> I created and moved a pane-maximize repository on GitHub. >> https://github.com/pi8027/pane-maximize > > I took a look at this, since I'm quite keen to ensure that if this script or > one like it is to replace the current "tmux-zoom.sh" script, that it > actually works this time. > > I can't quite see how your script does work though, so I've got some > questions: > >> #!/bin/bash > > #!/usr/bin/env bash Or, better, make it POSIX compliant. > (For those people on BSD where /bin/bash is not guaranteed.) > >> # By Kazuhiko Sakaguchi. Public domain. >> >> function usage_exit(){ >> cat <> Usage: $(echo $0 | sed "s/.*\///") [-adP] [-F format] [-t target-pane] > > Why not using "basename" here? Also, any unrecognized parameters should just be passed to tmux for future-proofing. >> exit $1 > > I think you should just exit 1 here, and not worry about passing in some > value for this. Agreed. Plus, -1 as the return code is...odd. >> $optflag_a && nwopts="-a -t $winid $nwopts" > > It is perhaps preferrable to not treat optflag_a as some literal boolean, > but rather use something like: > > [ -n "$optflag_a" ] && nwopts="-a -t $winid $nwopts" I tend to use `true` and `false` for booleans. It's an exec either way. It also allows for some option to determing the `-a` argument in some more complex way. >> if target=$(echo $pmtable | tr : "\n" | \ >> grep -E "(=|^)$paneid(=|$)" | head -n 1 | grep .) ; then > > > Ugh. :) What is this trying to do? (I know what it's doing, it's a > rhetorical question). At this point, the "if" condition is wholly > incorrect. I suggest this: It seems to be trying to count matches. The `-q` and `-c` flags should be used instead. -- Ben -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: [PATCH 0/1] Hook support: proof-of-concept
On Sun, Nov 04, 2012 at 01:22:50 GMT, Thomas Adam wrote: > I'm attaching one patch for now -- an idea for how hook support in tmux > might work. There's no documentation yet as I envisage things still in a > state of flux. Nice :) . > All commands that tmux recognise have the ability to have hooks attached to > them. These hooks in turn can run other tmux commands (and hence run-shell > for external commands). Hooks come in two forms: 'after' and 'before'; > that is to say, hooks can run before or after a given tmux command. > > Here's an example: > > set-hook -g -n'after-new-window' 'run "notify-send new window..."' > set-hook -g -n'before-new-window' 'display-message creating new window"' Could a `-w` flag for 'when' the hook is to be called could be done instead of embedding it into the name? I'd also prefer pre/post over before/after, but it's not a big deal. > This adds two hooks to the global hooks -- which are inherited by all > sessions. Per-sessions hooks are supported too: > > set-hook -nfoo -n'after-new-window' 'run "notify-send new window..."' > set-hook -nfoo -n'before-new-window' 'display-message creating new window"' Could a `run-hook` command be added so that session hooks can chain-call the global hooks manually? > As with key-bindings, multiple commands can be bound with ";", but there can > only ever be two hooks (before/after) per tmux command. With the Python stuff and a dynamic command table, custom aliases could be added to get multiple hooks. That loses support for scripts for the most part though (no generic script is going to call `tmux my-new-window` by default. What about hooks for things like when a pane/window/session ends? > So some questions (in no particular order): > > * The hook-name matters; at the moment the implementation assumes > cmd->entry->name and NOT cmd->entry->alias -- should both be checked? > That might mean though one can have a hook with both "new-window" and > "neww" defined, which is bad. +1 for full name only. > * Per-session hooks are only ever enacted if the command sent to them comes > from the client attached to that session. So for example, if I have this > binding: > > set-hook -nfoo -n'after-new-window' 'run "notify-send new window..."' > > and I run the following from either outside of an attached tmux session, > or some other session which ISN'T "foo": > > tmux new-window -tfoo > > then I will never see the specified hook run. > > This is because the cmd_ctx used to run hooks only knows about the context > of where the command was run *from*. I'm wondering how much of a drawback > this will be, or whether this makes sense? I'm not sure it does though > because if I manipulate a session from some other session which has hooks, > I'd expect those hooks to run. > > To "fix" this, we would need to change where and how hooks are run from, > much like the notify_() hooks do now, but there would then be no > before/after mechanism. Hrm...I think I'd prefer the target's hooks run instead of depending on the context. I can forsee questions such as "why aren't my hooks running?" with this behavior if it's not made perfectly obvious from the documentation. > * At present, there's no information passed down to commands about the hook > being run. For example if I had this: > > set-hook -nfoo -n'after-new-window' 'run "my_shell_script.sh"' > > we should provide some information such as the session name, etc., so that > external commands can manipulate what ever they need to in context. For commands such as set-environment or set-option, passing the values that caused the hook to be called would be nice to have. That ability would be worth losing before/after hook calls, IMO. Maybe having both would be nice (-w )? Not sure how that would work if 'during' hooks have a different API than 'before' or 'after' hooks. Would a non-zero exit status from a 'before' ('during' might be too late in the general case) hook be able to cancel the command? Maybe a flag for `set-hook` to do so would be useful? One potential problem I can think of with this behavior is how it might confuse a control-mode client. An `-n` flag to the main tmux executable to suppress all hook support (à là `git commit -n`) might be worthwhile as well. -- Ben -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Tmux hangs after a while
On Sat, Dec 08, 2012 at 18:29:24 GMT, Guang-Nan Cheng wrote: > set-option -g set-titles-string "@#(hostname | sed 's/..*//')" Why not use #h or hostname -s? --Ben -- 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: [PROPOSED FEATURE & PATCH] Add the ability to automatic renaming to show the cwd.
On Mon, Dec 10, 2012 at 05:13:43 GMT, Patricio Palladino wrote: > Hi tmux community! > > I have been using tmux for the last year, and has became an essential > tool for my development job, but I used to use panes almost > exclusively until some months ago. I think automatic renaming is a > great feature to remember which tab is which, and I couldn't live > without it. But it gets somewhat useless when you have many windows > with title "zsh", so I spent quite a long time trying to make a zsh > hook to put the cwd instead of that, but didn't get the expected > results (automatic renaming stopped working, or it ignored > automatic-rename setting and change it always). I use the following setup: In .tmux.conf (ignoring colors): setw -g window-status-format '#I.#P#F:#T-#W' At shell startup: tmux_title () { if [ -z "$TMUX" ]; then return 1 fi if [ "$#" -eq 0 ]; then tmux display-message -p -t "$TMUX_PANE" -F "#{pane_title}" else local title title="$1" shift printf "\033]2;$title\033\\" fi } # Initialize to nothing iff it isn't already set. if [ "$( tmux_title )" = "$HOSTNAME" ]; then tmux_title "" fi I then have a command "cdb" which uses "bookmarks" to change to a project's directory, clear the directory stack, and to use the tmux_title function to set the title on the pane. By default windows in the status bar look like: 1.0-:-irssi and after using cdb it is: 3.0-:uzbl-zsh > So I decided to add this feature to tmux myself, and to my surprise it > was really easy. tmux codebase is one of the cleanest C codes I've > ever seen, indeed. Agreed, I do love me clean C code (MPD is another example). -- Ben -- 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: [PROPOSED FEATURE & PATCH] Add the ability to automatic renaming to show the cwd.
On Tue, Dec 11, 2012 at 04:09:17 GMT, Patricio Palladino wrote: > Nice setup. But I find difficult to remember to alwas use a diffent > command to "cd". I don't use it as a standard 'cd' option. I have zsh tab-completion for it too, so it's not that much of an issue confusing the two. --Ben -- 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: [PATCH] Include command alias in lscm output
On Fri, 01 Feb, 2013 at 19:38:12 GMT, Thomas Adam wrote: > When printing out the command usage, include the command's alias as well. > --- > cmd-list-commands.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/cmd-list-commands.c b/cmd-list-commands.c > index 68e0e80..b6c2f98 100644 > --- a/cmd-list-commands.c > +++ b/cmd-list-commands.c > @@ -43,7 +43,8 @@ cmd_list_commands_exec(unused struct cmd *self, struct > cmd_ctx *ctx) > const struct cmd_entry**entryp; > > for (entryp = cmd_table; *entryp != NULL; entryp++) > - ctx->print(ctx, "%s %s", (*entryp)->name, (*entryp)->usage); > + ctx->print(ctx, "%s (%s) %s", > + (*entryp)->name, (*entryp)->alias, (*entryp)->usage); > > return (CMD_RETURN_NORMAL); > } Hmm. Not all commands have an alias. Maybe: > - ctx->print(ctx, "%s %s", (*entryp)->name, (*entryp)->usage); > + ctx->print(ctx, "%s (%s) %s", > + (*entryp)->name, (*entryp)->alias ? (*entryp)->alias : > "", (*entryp)->usage); (better wrapped of course). I believe with the patch as-is, it would output: kill-server ((null)) ... --Ben -- Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: End of word in copy mode; don't include following character.
On Tue, 12 Feb, 2013 at 09:48:38 GMT, Nicholas Marriott wrote: > Hmm. We can't change next-word-end because it is used by emacs mode so > we'd have to add yet another new command for vi cursor movement. I don't > remember if we deliberately decided not to do this or not. I have it on my TODO list to make the word motion movements not do one-past if EDITOR contains 'vi' or the keybindings are vi-like. Haven't gotten around to any tmux hacking lately though :( . --Ben -- Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: End of word in copy mode; don't include following character.
On Wed, Feb 13, 2013 at 10:32:29 +0100, s...@sltosis.org wrote: > I am not sure this is the right words, but I find looking at the EDITOR env > var > a bit 'intrusive' and/or 'optimistic'. (hopefully you'll understand what I > mean) Actually, I think tmux defaults keybindings based on EDITOR, so just the keymap should be fine. > I'd stop at the keybindings configuration: vi-like or emacs-like Probably. I think a function which detected whether vi or emacs should be used is probably in order (ISTR there being a few places where it's checked). --Ben -- Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
if-shell background changes
Hi, I updated to the newest master recently and it seems as though the synchronous if-shell support has broken usage of it from ~/.tmux.conf. At the end of my .tmux.conf I have the following: # 256-color support if-shell -b 'test "`tput colors`" -eq 256' 'source-file "$XDG_CONFIG_HOME/tmux/256-colors"' if-shell -b 'test "`tput Co`" -eq 256' 'source-file "$XDG_CONFIG_HOME/tmux/256-colors"' With the new if-shell, I get: /home/boeckb/.tmux.conf:120: can't establish current session /home/boeckb/.tmux.conf:121: can't establish current session This happens with or without the '-b' flag. A subsequent sourcing of .tmux.conf is error-free. Is there a way to get if-shell to work without error messages on startup again? Or is there a better way of doing this? Thanks, --Ben -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: if-shell background changes
On Tue, Feb 26, 2013 at 19:55:39 +, Thomas Adam wrote: > This is, I presume, only when the server is initially started, yes? That > makes sense because here we see in cmd-if-shell.c:cmd_if_shell_exec(): Yes. Yep, that works. Patch attached which applied (I'm guessing the inlining mangled something) and with run-shell updated as well. Thanks, --Ben diff --git a/cmd-if-shell.c b/cmd-if-shell.c index b921f41..4d3e340 100644 --- a/cmd-if-shell.c +++ b/cmd-if-shell.c @@ -59,19 +59,21 @@ cmd_if_shell_exec(struct cmd *self, struct cmd_q *cmdq) struct args *args = self->args; struct cmd_if_shell_data*cdata; char*shellcmd; - struct session *s; - struct winlink *wl; - struct window_pane *wp; + struct session *s = NULL; + struct winlink *wl = NULL; + struct window_pane *wp = NULL; struct format_tree *ft; - wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp); - if (wl == NULL) - return (CMD_RETURN_ERROR); - + if (args_has(args, 't')) + wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp); ft = format_create(); - format_session(ft, s); - format_winlink(ft, s, wl); - format_window_pane(ft, wp); + + if (s != NULL) + format_session(ft, s); + if (s != NULL && wl != NULL) + format_winlink(ft, s, wl); + if (wp != NULL) + format_window_pane(ft, wp); shellcmd = format_expand(ft, args->argv[0]); format_free(ft); diff --git a/cmd-run-shell.c b/cmd-run-shell.c index aaa310b..5f34ee9 100644 --- a/cmd-run-shell.c +++ b/cmd-run-shell.c @@ -76,19 +76,21 @@ cmd_run_shell_exec(struct cmd *self, struct cmd_q *cmdq) struct args *args = self->args; struct cmd_run_shell_data *cdata; char*shellcmd; - struct session *s; - struct winlink *wl; - struct window_pane *wp; + struct session *s = NULL; + struct winlink *wl = NULL; + struct window_pane *wp = NULL; struct format_tree *ft; - wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp); - if (wl == NULL) - return (CMD_RETURN_ERROR); - + if (args_has(args, 't')) + wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp); ft = format_create(); - format_session(ft, s); - format_winlink(ft, s, wl); - format_window_pane(ft, wp); + + if (s != NULL) + format_session(ft, s); + if (s != NULL && wl != NULL) + format_winlink(ft, s, wl); + if (wp != NULL) + format_window_pane(ft, wp); shellcmd = format_expand(ft, args->argv[0]); format_free(ft); -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Add TMUX_TMPDIR environment variable
Hi, Attached is a patch which adds support for a TMUX_TMPDIR environment variable to set the directory for tmux sockets. The TMPDIR variable isn't acceptable here since it always appends "/tmux-$UID" to the directory. My use case is to put all of my sockets into XDG_RUNTIME_DIR. It would also allow setups with shared tmux usage without having to remember/alias -S onto all of the commands and without sharing everything which uses TMPDIR. Since I'm guessing direct usage of XDG_RUNTIME_DIR (based on previous discussion about XDG_* environment support) wouldn't be accepted, a more general way which I can use to put sockets there is acceptable for me. Thanks, --Ben >From 56057f3d7b33f78512d1ec68f37e1d7cb0c32f87 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 19 Mar 2013 15:05:01 -0400 Subject: [PATCH] Support TMUX_TMPDIR --- tmux.1 | 10 ++ tmux.c | 8 +--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/tmux.1 b/tmux.1 index bd56044..4062261 100644 --- a/tmux.1 +++ b/tmux.1 @@ -139,11 +139,13 @@ shows any error messages from commands in configuration files in the first session created, and continues to process the rest of the configuration file. .It Fl L Ar socket-name .Nm -stores the server socket in a directory under -.Pa /tmp -(or +stores the server socket in +.Ev TMUX_TMPDIR +if set, otherwise in a directory under .Ev TMPDIR -if set); +(defauting to +.Pa /tmp +if unset); the default socket is named .Em default . This option allows a different socket name to be specified, allowing several diff --git a/tmux.c b/tmux.c index 4b58aba..32050f7 100644 --- a/tmux.c +++ b/tmux.c @@ -167,10 +167,12 @@ makesocketpath(const char *label) u_int uid; uid = getuid(); - if ((s = getenv("TMPDIR")) == NULL || *s == '\0') - xsnprintf(base, sizeof base, "%s/tmux-%u", _PATH_TMP, uid); - else + if ((s = getenv("TMUX_TMPDIR")) != NULL && *s != '\0') + xsnprintf(base, sizeof base, "%s/", s); + else if ((s = getenv("TMPDIR")) != NULL && *s != '\0') xsnprintf(base, sizeof base, "%s/tmux-%u", s, uid); + else + xsnprintf(base, sizeof base, "%s/tmux-%u", _PATH_TMP, uid); if (mkdir(base, S_IRWXU) != 0 && errno != EEXIST) return (NULL); -- 1.8.1.4 -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Add TMUX_TMPDIR environment variable
On Fri, Mar 22, 2013 at 08:35:10 +, Nicholas Marriott wrote: > Perhaps TMUX_SOCKET to act like -S instead might be better? Then you can > put it where you like without tmux creating directories. That might also be good, but I'd like any tmux sessions I create use the directory without having to set TMUX_SOCKET every time I want a new server (it's effectively no improvement over -S at that point). --Ben -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCH 1/3] Add wait-for command to tmux.vim
--- examples/tmux.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tmux.vim b/examples/tmux.vim index 076115c..e85f8ff 100644 --- a/examples/tmux.vim +++ b/examples/tmux.vim @@ -56,7 +56,7 @@ syn keyword tmuxCmds \ list-buffers loadb load-buffer pasteb paste-buffer saveb save-buffer \ setb set-buffer showb show-buffer \ clock-mode if[-shell] lock[-server] run[-shell] server-info info - \ choose-list + \ choose-list wait-for syn keyword tmuxOptsSet \ buffer-limit escape-time exit-unattached exit-unattached quiet -- 1.8.1.4 -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCH 2/3] Document -o flag to set-window-option in manpage
--- tmux.1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tmux.1 b/tmux.1 index 05dfac6..ea4fdad 100644 --- a/tmux.1 +++ b/tmux.1 @@ -2652,7 +2652,7 @@ The default is .Ql \ -_@ . .El .It Xo Ic set-window-option -.Op Fl agqu +.Op Fl agoqu .Op Fl t Ar target-window .Ar option Ar value .Xc @@ -2661,6 +2661,7 @@ Set a window option. The .Fl a , .Fl g , +.Fl o , .Fl q and .Fl u -- 1.8.1.4 -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCH 3/3] Minor whitespace nits
--- compat/getopt.c | 2 +- layout-set.c| 2 +- tmux.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compat/getopt.c b/compat/getopt.c index 38c317c..2a60b14 100644 --- a/compat/getopt.c +++ b/compat/getopt.c @@ -107,7 +107,7 @@ BSDgetopt(int nargc, char *const *nargv, const char *ostr) __progname, BSDoptopt); return (BADCH); } - else/* white space */ + else/* white space */ BSDoptarg = nargv[BSDoptind]; place = EMSG; ++BSDoptind; diff --git a/layout-set.c b/layout-set.c index 646528b..15fe5a6 100644 --- a/layout-set.c +++ b/layout-set.c @@ -35,7 +35,7 @@ void layout_set_tiled(struct window *); const struct { const char *name; - void(*arrange)(struct window *); + void(*arrange)(struct window *); } layout_sets[] = { { "even-horizontal", layout_set_even_h }, { "even-vertical", layout_set_even_v }, diff --git a/tmux.c b/tmux.c index 8ea91eb..feda59e 100644 --- a/tmux.c +++ b/tmux.c @@ -51,7 +51,7 @@ pid_t environ_pid = -1; int environ_session_id = -1; __dead void usage(void); -voidparseenvironment(void); +voidparseenvironment(void); char *makesocketpath(const char *); #ifndef HAVE___PROGNAME -- 1.8.1.4 -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCH 0/3] Minor nits in 1.8
Minor nits I encountered when going over the history for zsh completion script. Ben Boeckel (3): Add wait-for command to tmux.vim Document -o flag to set-window-option in manpage Minor whitespace nits compat/getopt.c | 2 +- examples/tmux.vim | 2 +- layout-set.c | 2 +- tmux.1| 3 ++- tmux.c| 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) -- 1.8.1.4 -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Changes to tmux-code.git on SF -- "master" branch rewound.
On Tue, 26 Mar, 2013 at 16:08:43 GMT, Nicholas Marriott wrote: > Not enough. Just renaming it is not ok. mode-mouse does this: > > - Click to paste outside copy mode. > - Copy text on drag outside copy mode. > - Copy text on drag inside copy mode. > - Scroll up and down in copy mode. > - Select item in choose mode. > > The reason mode-mouse was chosen as the name was because originally it > just controlled whether mouse events went through to ANY mode. Now that > it does more and we have other options called mouse-* the name is not > ideal but just renaming it is not enough. > > We could split it up into a few options but what? Since most people are > just going to turn them all on or all off we shouldn't have too many. Instead of splitting it, why not have an option for each use of the mouse and mouse-mode enables/disables all of them (not the actual values, but any checks would do ("mouse-mode" && "mouse-action") instead). I can see some liking mouse mode in some contexts and not in others, but still want the ability to turn off the mouse wholesale.[1] --Ben [1]But don't take my word for it; I don't use the mouse with tmux beyond X primary selection copy/paste :) . -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Pinentry prompt showing up on seemingly-random terminals
On Sat, 06 Apr, 2013 at 19:31:33 GMT, Erik Johnson wrote: > I use gpg-agent (with ssh support enabled), and when I use pinentry-curses > from within tmux, the pinentry prompt rarely appears in the current pane. > Sometimes it appears in a different window, sometimes it appears on tty1, > there doesn't seem to be a rhyme or reason to it (though there is probably > some pattern, which I am just not seeing). > > I've taken to using the gtk2 version of pinentry to get a prompt to appear > reliably, but this means that I need to forward X11 to get it to work on a > remote workstation. I'd rather just use pinentry-curses so I don't have to > do that. > > I'm guessing that the problem here is a misconfigration on my end, but I'm > at a loss for what it might be. Here is my .tmux.conf, for reference: > http://pastebin.com/xd3gQpSq In my zshrc I have: GPG_TTY=$( tty ) export GPG_TTY This ensures that any pinentry-curses launched from a terminal gets the right ptty[1]. --Ben [1]I think anyways; I don't really use pinentry much; mutt usually asks me. -- Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: [PATCH 0/3] Minor nits in 1.8
On Sat, Apr 06, 2013 at 00:04:11 -0400, Ben Boeckel wrote: > Minor nits I encountered when going over the history for zsh completion > script. Found another when looking through the docs. --Ben >From 717183b45d71cec7bf12148d4db1db4fec9b7b13 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 24 Apr 2013 02:07:38 -0400 Subject: [PATCH] The -b flag is optional on run-shell --- tmux.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmux.1 b/tmux.1 index ea4fdad..88b99a5 100644 --- a/tmux.1 +++ b/tmux.1 @@ -3543,7 +3543,7 @@ Lock each client individually by running the command specified by the .Ic lock-command option. .It Xo Ic run-shell -.Fl b +.Op Fl b .Op Fl t Ar target-pane .Ar shell-command .Xc -- 1.8.2.1 -- Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: [PATCH 0/3] Minor nits in 1.8
On Wed, Apr 24, 2013 at 08:59:45 +0100, Thomas Adam wrote: > Thanks. Please remember though that tmux.1 is now copied from tmux.1.in. > That's the file you ought to be patching. Yeah, I had rebased after sending out the patch after realizing I was on a separate branch. That branch is now unneeded anyways, so I'm now back on master. --Ben -- Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCH 5/6] Move to the indentation of a line on scrolling
When scrolling by page or half-page, vim moves to the first non-whitespace character of a line. Emulate the behavior in copy mode. --- window-copy.c | 4 1 file changed, 4 insertions(+) diff --git a/window-copy.c b/window-copy.c index ee6a2e8..17808b8 100644 --- a/window-copy.c +++ b/window-copy.c @@ -458,6 +458,7 @@ window_copy_key(struct window_pane *wp, struct session *sess, int key) case MODEKEYCOPY_PREVIOUSPAGE: for (; np != 0; np--) window_copy_pageup(wp); + window_copy_cursor_back_to_indentation(wp); break; case MODEKEYCOPY_NEXTPAGE: n = 1; @@ -471,6 +472,7 @@ window_copy_key(struct window_pane *wp, struct session *sess, int key) } window_copy_update_selection(wp); window_copy_redraw_screen(wp); + window_copy_cursor_back_to_indentation(wp); break; case MODEKEYCOPY_HALFPAGEUP: n = screen_size_y(s) / 2; @@ -482,6 +484,7 @@ window_copy_key(struct window_pane *wp, struct session *sess, int key) } window_copy_update_selection(wp); window_copy_redraw_screen(wp); + window_copy_cursor_back_to_indentation(wp); break; case MODEKEYCOPY_HALFPAGEDOWN: n = screen_size_y(s) / 2; @@ -493,6 +496,7 @@ window_copy_key(struct window_pane *wp, struct session *sess, int key) } window_copy_update_selection(wp); window_copy_redraw_screen(wp); + window_copy_cursor_back_to_indentation(wp); break; case MODEKEYCOPY_TOPLINE: data->cx = 0; -- 1.8.2.1 -- This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users