[tmux:tickets] #172 Custom modes

2014-12-17 Thread Ross



---

** [tickets:#172] Custom modes**

**Status:** open
**Created:** Tue Dec 16, 2014 06:15 PM UTC by Ross
**Last Updated:** Tue Dec 16, 2014 06:15 PM UTC
**Owner:** nobody

Tmux already has the concept of modes, and key mappings for those modes via 
`bind-key -t`.  It would be great if users could make arbitrary modes, which 
would let us create multiple keystroke bindings.

This was worked on 
[here](http://sourceforge.net/p/tmux/mailman/message/32331408/), though as 
there is no ticket for it and no activity I think it may have gotten lost.


---

Sent from sourceforge.net because tmux-users@lists.sourceforge.net is 
subscribed to https://sourceforge.net/p/tmux/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/tmux/admin/tickets/options.  Or, if this is a mailing 
list, you can unsubscribe from the mailing list.--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


AIX: fatal: main_dispatch: imsg_read failed

2010-12-13 Thread Ross Mohn
 Got tmux-1.3 and libevent-1.4.14b-stable to compile on AIX-6.1.0.0 but
as soon as I run it I get "fatal: main_dispatch: imsg_read failed".  My
brief debugging shows that imsg_read() is returning "0" to
main_dispatch(), but I haven't been able to get any farther with it.
I've attached a log produced by "tmux -". Any ideas how I can get
this running on AIX?

Thanks! -Ross

server started, pid 426512
new client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 14 from client 7
got 6 from client 7
lost client 7
--
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


AIX: fatal: main_dispatch: imsg_read failed

2010-12-13 Thread Ross Mohn
 Got tmux-1.3 to compile on AIX v, but as soon as I run it I get "fatal:
main_dispatch: imsg_read failed".  I've attached the log produced by
"tmux -". An
--
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: AIX: fatal: main_dispatch: imsg_read failed

2010-12-20 Thread Ross Mohn
 CVS HEAD seems to work on AIX 6 now. I only adjusted it from curses to
ncursesw:

config.mk -- from -lcurses to -lncursesw
tty-term.c -- from  to 
tty-term.c -- from  to 

Thanks! -Ross


On 12/13/2010 02:59 PM, Nicholas Marriott wrote:
> Try CVS HEAD, AIX works better although not perfectly.
>
>
>
> On Mon, Dec 13, 2010 at 02:53:27PM -0500, Ross Mohn wrote:
>>  Got tmux-1.3 and libevent-1.4.14b-stable to compile on AIX-6.1.0.0 but
>> as soon as I run it I get "fatal: main_dispatch: imsg_read failed".  My
>> brief debugging shows that imsg_read() is returning "0" to
>> main_dispatch(), but I haven't been able to get any farther with it.
>> I've attached a log produced by "tmux -". Any ideas how I can get
>> this running on AIX?
>>
>> Thanks! -Ross
>>
>> server started, pid 426512
>> new client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 14 from client 7
>> got 6 from client 7
>> lost client 7
>> --
>> Lotusphere 2011
>> Register now for Lotusphere 2011 and learn how
>> to connect the dots, take your collaborative environment
>> to the next level, and enter the era of Social Business.
>> http://p.sf.net/sfu/lotusphere-d2d
>> ___
>> tmux-users mailing list
>> tmux-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/tmux-users

--
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: [PATCH] Allow custom key tables for e.g. multiple keystroke bindings.

2015-04-13 Thread Ross Hadden
Keith Amling  palantir.com> writes:

> 
> > > > Or are you thinking of creating the table after running the set 
command?
> > > > This shouldn't work - you shouldn't be able to set a client to a
> > > > nonexistent table.
> > > 
> > > I guess I don't super care what happens since I won't personally be
> > > writing any switch-client -T into an empty table but I had assumed we
> > > would allow switching to a new [and ephemeral] table since otherwise
> > > switch-client -T can fail which just seems weird to me.
> > 
> > I'd say it should fail if the table doesn't exist.
> > 
> > I can't think of a case where I would want it to automatically create a
> > table, except to confuse people who make a typo in the table name. Do
> > you have a use in mind?
> 
> Not specifically, I just prefer to see tools degrade what might be
> described as "uniformly" where possible.  Nonuniform behaviour makes
> tools dangerous for automated use because when writing a script you're
> unlikely to think of things like "what if this table is empty" or "what
> if this command barfs on no args when really no args means I just didn't
> need it to do anything".
> 
> I'll switch it and the next set of patches will be up shortly.
> 
> Keith
> 
> --

> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform 
available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> 


Has work on this continued?  I made an issue about it 
(https://sourceforge.net/p/tmux/tickets/172/) in an effort to bring 
attention to this patch, but Thomas said it's pretty much not going anywhere 
unless the original patch author continues or makes an effort to get it 
merged himself.

I would love to see this landed in tmux!  My current workaround can be seen 
at https://github.com/rosshadden/dotfiles/blob/master/src/.tmux.conf#L79-L85 
and https://github.com/rosshadden/dotfiles/blob/master/src/lib/tmux-
cords.sh.


--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: [PATCH] Allow custom key tables for e.g. multiple keystroke?bindings.

2015-04-20 Thread Ross Hadden
Would you mind making a merge request for it?  I could, but it wouldn't
really be right to make a merge request with someone else's hard work!
Your name should be on this.

Thanks,

~Ross

On Mon, Apr 13, 2015 at 5:30 PM Nicholas Marriott <
nicholas.marri...@gmail.com> wrote:

> Here's the latest diff.
>
> It actually seems to work fine, although I haven't done a lot of testing.
>
> IIRC I wasn't wild about the cmd-list-keys.c and cmd-bind-key.c changes;
> certainly lsk -T should error on an unknown table, same as bind -T. I
> think the manpage bits could do with some improvement too.
>
>
> Index: cmd-bind-key.c
> ===
> RCS file: /cvs/src/usr.bin/tmux/cmd-bind-key.c,v
> retrieving revision 1.20
> diff -u -p -r1.20 cmd-bind-key.c
> --- cmd-bind-key.c  10 Apr 2015 16:00:08 -  1.20
> +++ cmd-bind-key.c  13 Apr 2015 21:29:21 -
> @@ -33,8 +33,8 @@ enum cmd_retvalcmd_bind_key_mode_table
>
>  const struct cmd_entry cmd_bind_key_entry = {
> "bind-key", "bind",
> -   "cnrt:", 1, -1,
> -   "[-cnr] [-t mode-table] key command [arguments]",
> +   "cnrt:T:", 1, -1,
> +   "[-cnr] [-t mode-table] [-T key-table] key command [arguments]",
> 0,
> cmd_bind_key_exec
>  };
> @@ -46,6 +46,7 @@ cmd_bind_key_exec(struct cmd *self, stru
> char*cause;
> struct cmd_list *cmdlist;
> int  key;
> +   const char  *tablename;
>
> if (args_has(args, 't')) {
> if (args->argc != 2 && args->argc != 3) {
> @@ -68,6 +69,13 @@ cmd_bind_key_exec(struct cmd *self, stru
> if (args_has(args, 't'))
> return (cmd_bind_key_mode_table(self, cmdq, key));
>
> +   if (args_has(args, 'T'))
> +   tablename = args_get(args, 'T');
> +   else if (args_has(args, 'n'))
> +   tablename = "root";
> +   else
> +   tablename = "prefix";
> +
> cmdlist = cmd_list_parse(args->argc - 1, args->argv + 1, NULL, 0,
> &cause);
> if (cmdlist == NULL) {
> @@ -76,9 +84,7 @@ cmd_bind_key_exec(struct cmd *self, stru
> return (CMD_RETURN_ERROR);
> }
>
> -   if (!args_has(args, 'n'))
> -   key |= KEYC_PREFIX;
> -   key_bindings_add(key, args_has(args, 'r'), cmdlist);
> +   key_bindings_add(tablename, key, args_has(args, 'r'), cmdlist);
> return (CMD_RETURN_NORMAL);
>  }
>
> Index: cmd-list-keys.c
> ===
> RCS file: /cvs/src/usr.bin/tmux/cmd-list-keys.c,v
> retrieving revision 1.25
> diff -u -p -r1.25 cmd-list-keys.c
> --- cmd-list-keys.c 20 Oct 2014 23:27:14 -  1.25
> +++ cmd-list-keys.c 13 Apr 2015 21:29:21 -
> @@ -33,8 +33,8 @@ enum cmd_retvalcmd_list_keys_commands(
>
>  const struct cmd_entry cmd_list_keys_entry = {
> "list-keys", "lsk",
> -   "t:", 0, 0,
> -   "[-t key-table]",
> +   "t:T:", 0, 0,
> +   "[-t mode-table] [-T key-table]",
> 0,
> cmd_list_keys_exec
>  };
> @@ -51,58 +51,65 @@ enum cmd_retval
>  cmd_list_keys_exec(struct cmd *self, struct cmd_q *cmdq)
>  {
> struct args *args = self->args;
> +   struct key_table*table;
> struct key_binding  *bd;
> -   const char  *key;
> -   char tmp[BUFSIZ], flags[8];
> +   const char  *key, *tablename, *r;
> +   char tmp[BUFSIZ];
> size_t   used;
> -   int  width, keywidth;
> +   int  repeat, width, tablewidth, keywidth;
>
> if (self->entry == &cmd_list_commands_entry)
> return (cmd_list_keys_commands(self, cmdq));
>
> if (args_has(args, 't'))
> return (cmd_list_keys_table(self, cmdq));
> +   tablename = args_get(args, 'T');
>
> -   width = 0;
> -
> -   RB_FOREACH(bd, key_bindings, &key_bindings) {
> -   key = key_string_lookup_key(bd->key & ~KEYC_PREFIX);
> -   if (key == NULL)
> +   repeat = 0;
> +   tablewidth = keywidth = 0;
> +   RB_FOREACH(table, key_tables, &key_tables) {
> +   if (tablename != NULL &&