Command line history & tab-completion for sftp in OS X Terminal.app

8

4

I use Terminal.app constantly. When connecting via ssh to remote *nix systems, I can continue to use tab to complete command names and arrow-up/down to navigate the command history. However, with sftp this does not work, and I get [-escaped sequences for the latter and a literal tab for the former.

Any way to get this to work? Anything to do with readline?

chryss

Posted 2010-08-16T10:48:37.057

Reputation: 338

Answers

3

Check out with-readline. There's an example using sftp there.

Doug Harris

Posted 2010-08-16T10:48:37.057

Reputation: 23 578

1Only problem is it's shows password. – shantanu – 2017-02-14T06:54:31.387

2.. and it completes based on the local folder, not the remote folder – Jasper de Vries – 2018-01-10T18:28:10.827

4

Having tried to install with-readline on OSX 10.7.5 I ran into linker errors.

While trying to find a solution to this problem I discovered that MacPorts has a port of OpenSSH which includes the sftp utility compiled with readline support. MacPorts also sets this version of sftp as the default.

Phy51x

Posted 2010-08-16T10:48:37.057

Reputation: 66

2The same solution can be applied if you prefer Homebrew, their version of homebrew/dupes/openssh also comes with tab completion. – GhostLyrics – 2016-07-05T13:21:28.793

3

You can also try yafc.

Marlon

Posted 2010-08-16T10:48:37.057

Reputation: 31