Skip to content


Subversion checkout URL

You can clone with
Download ZIP


SCPing a file to a server running fish fails when prints anything #623

robacarp opened this Issue · 5 comments

3 participants


In my fish config, I have this little bit of logic that takes care of some command incompatibilities between OS X's bsd ls and a Debian ls:

Through some poking at a problem I was having using SCP to copy to a remote server using the same config file, I found out that something about printing from a on a remote host causes the scp transfer to fail silently.


Very strange. Why would scp do an interactive login anyways?


Well, that was my thought.

I vaguely remember some logic in a bashrc I wrote one that had a early exit if it detected it was being included non-interactively.

Nothing strange from the scp command, just the basic scp file remote:~ stuff.


This also happens with bash, in case you don't know. It's because scp is a failure that expects you to be insane (sadly). See You could try moving part that outputs stuff to fish_greeting function, it's automatically ran only in interactive mode. Or checking whatever you are using following snippet.

if status --is-login
    echo Hello, world!

If anything shows when you run ssh ssh-server /bin/true, something is wrong, and SCP and SFTP will break badly.

Technically, fish could redirect entire output of init script when running it non-interactively to /dev/null, but that would be annoying when you really would want to print something. bash doesn't do that anyway, so it has similar issues with .bashrc.


Thanks very much for the explanation GlitchMr.

(Your second sentence made me laugh.)


Indeed, thanks for the explanation and the code sample.

@robacarp robacarp closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.