I'm going to echo Martijn's opinion below.

Nearly 95% of my ssh sessions to lots of systems start with alt-. followed
by a few keys typed to confirm the hostname is correct followed by enter.

Typing the full hostname or providing shortened versions in .ssh/config is
unwieldy and quite cumbersome otherwise.

I've come to use this feature as a very trusted time saver in my regular
day.

I'd say I use it on average 100 or more times per day.

What are our options to replace it with equivalent functionality should you
feel the need to march on without it?

Thanks,

Penned by Martijn van Duren on 20170710  0:01.54, we have:
| As a sysadmin with access to over a couple of 100 machines I find this
| feature extremely useful. It would require me quite a bit of extra
| brainpower to remember the correct/full hostname of each and every one
| of them, especially since I can start typing halfway through the
| hostname.
| 
| So yeah, I think it'd would be a shame if this feature would disappear.
| 
| martijn@
| 
| On 07/07/17 18:44, Okan Demirmen wrote:
| > Hi cwm users,
| > 
| > In converting this to use getline(3) over fgetln(3), I'm asking the 
question if
| > this (imho) mis-feature belongs in a window manager. I've hinted at wanting 
to
| > remove it in the past but there was opposition.  As a compromise, we could 
just
| > leave the 'ssh>' menu available, but it will not be pre-populated (nor
| > auto-completed) by what's in ~/.ssh/known_hosts; just type in the
| > host/ip/whatever at the menu prompt. cwm(1) does a very rudimentary pass at
| > parsing the known_hosts file, and there's no reason to hoist code from 
ssh(1)
| > just to get auto-completion in a window manager menu.
| > 
| > Below is the minimal code part in kbfunc_menu_ssh().
| > 
| > Preferably, I'd like to remove the whole ssh menu, but can live with the 
below
| > if it's useful to others.
| > 
| > Thoughts?
| > 
| > Thanks,
| > Okan
| > 
| > Index: kbfunc.c
| > ===================================================================
| > RCS file: /home/open/cvs/xenocara/app/cwm/kbfunc.c,v
| > retrieving revision 1.145
| > diff -u -p -r1.145 kbfunc.c
| > --- kbfunc.c        9 May 2017 13:40:18 -0000       1.145
| > +++ kbfunc.c        6 Jul 2017 19:36:13 -0000
| > @@ -462,50 +462,16 @@ kbfunc_menu_ssh(void *ctx, struct cargs 
| >     struct cmd_ctx          *cmd;
| >     struct menu             *mi;
| >     struct menu_q            menuq;
| > -   FILE                    *fp;
| > -   char                    *buf, *lbuf, *p;
| > -   char                     hostbuf[HOST_NAME_MAX+1];
| >     char                     path[PATH_MAX];
| >     int                      l;
| > -   size_t                   len;
| >  
| >     TAILQ_FOREACH(cmd, &Conf.cmdq, entry) {
| >             if (strcmp(cmd->name, "term") == 0)
| >                     break;
| >     }
| > -   TAILQ_INIT(&menuq);
| >  
| > -   if ((fp = fopen(Conf.known_hosts, "r")) == NULL) {
| > -           warn("%s: %s", __func__, Conf.known_hosts);
| > -           goto menu;
| > -   }
| > +   TAILQ_INIT(&menuq);
| >  
| > -   lbuf = NULL;
| > -   while ((buf = fgetln(fp, &len))) {
| > -           if (buf[len - 1] == '\n')
| > -                   buf[len - 1] = '\0';
| > -           else {
| > -                   /* EOF without EOL, copy and add the NUL */
| > -                   lbuf = xmalloc(len + 1);
| > -                   (void)memcpy(lbuf, buf, len);
| > -                   lbuf[len] = '\0';
| > -                   buf = lbuf;
| > -           }
| > -           /* skip hashed hosts */
| > -           if (strncmp(buf, HASH_MARKER, strlen(HASH_MARKER)) == 0)
| > -                   continue;
| > -           for (p = buf; *p != ',' && *p != ' ' && p != buf + len; p++) {
| > -                   /* do nothing */
| > -           }
| > -           /* ignore badness */
| > -           if (p - buf + 1 > sizeof(hostbuf))
| > -                   continue;
| > -           (void)strlcpy(hostbuf, buf, p - buf + 1);
| > -           menuq_add(&menuq, NULL, "%s", hostbuf);
| > -   }
| > -   free(lbuf);
| > -   (void)fclose(fp);
| > -menu:
| >     if ((mi = menu_filter(sc, &menuq, "ssh", NULL, (CWM_MENU_DUMMY),
| >         search_match_text, search_print_text)) != NULL) {
| >             if (mi->text[0] == '\0')
| > 

-- 
Todd T. Fries . http://todd.fries.net/pgp.txt . @unix2mars . github:toddfries

Reply via email to