Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: scp completion options



On Thursday 28 June 2018 17:31,
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> put forth the proposition:
> On Thu, Jun 28, 2018 at 1:56 PM, David Woodfall <dave@xxxxxxxxxxxxxx> wrote:
> >
> > Things I've tested so far:
> >
> > [...]
>
> _remote_files is most likely running
>   ssh -o BatchMode=yes -a -x $host ls -d1FL --
> where $host is obviously the remote name.  Try running that directly
> from your command line and see what you get.
>
> Try again replacing "ls" with /bin/ls just in case an alias is somehow
> being invoked, or find out if you have some other "ls" in the default
> search path.

Well I had another look at the problem of those escape characters
today and think that I've found the problem. I made a ssh function
some time ago that would change my screen title to user@host:

ssh() {
  print -n "\ek${*##* }\e\\"
  /usr/bin/ssh $@ 
  print -n \\ek${${(%)SCREEN//screen-*/%~}#\~/}\\e\\\\
}

I didn't realize that scp would also run the ssh binary. I assumed that its
autocomplete stuff was some build-in code.

To get around this I renamed the ssh function to mmmssh and then created

alias ssh='mmmssh'

Aliases are only available in an interactive shell.

Pretty daft way to get a user@host but it works. There's probably a more sane
way to do this.

Thanks for all the help and clues where to look.

-Dave

--

Besides, its really not worthwhile to use more than two times your physical
ram in swap (except in a select few situations). The performance of the system
becomes so abysmal you'd rather heat pins under your toenails while reciting
Windows95 source code and staring at porn flicks of Bob Dole than actually try
to type something.
  -- seen on c.o.l.development.system, about the size of the swap space

                                                            .--.  oo
                                                           (____)//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'



Messages sorted by: Reverse Date, Date, Thread, Author