You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
scp to fish throws 'Could not set up terminal' #4432
Mostly the same as issues/3165
I try to scp file from machine B to machine A with machine A's fish.
machine A(127.0.0.1) is the one I am using locally with fish,machine A installed fish as the default login shell.
machine B(25.41.29.133)is the remote one I try to copy file from,machine B installed fish as the default login shell.
when I try to execute below command in machine A,it tellls me open terminal failed: not a terminal
scp [email protected]:/Users/3xp10it/mypypi/exp10it.py /tmp/
Password:
open terminal failed: not a terminal
TERM environment variable not set.
You provided some configuration information, but it’s not clear which of the two PCs it pertains to. Is the remote machine running the same environment?
If I may, I'm also having this issue, and it was fixed when I changed the remote server's default terminal to bash. Attached is my scp -vv output, starting after successful authentication and hopefully scrubbed of server-identifying information.
debug1: Authentication succeeded (publickey).
Authenticated to
debug2: fd 6 setting O_NONBLOCK
debug2: fd 7 setting O_NONBLOCK
debug1: channel 0: new [client-session]
debug2: channel 0: send open
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 5 setting TCP_NODELAY
debug2: client_session2_setup: id 0
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending command: scp -v -t /home/mvarga/personal_site/web/test.pdf
debug2: channel 0: request exec confirm 1
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
debug2: channel 0: rcvd ext data 1
fdebug2: channel 0: written 1 to efd 8
debug2: channel 0: rcvd ext data 1
idebug2: channel 0: written 1 to efd 8
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
sh: Cdebug2: channel 0: written 5 to efd 8
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
oudebug2: channel 0: written 2 to efd 8
debug2: channel 0: rcvd ext data 1
ldebug2: channel 0: written 1 to efd 8
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd ext data 1
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
debug2: channel 0: rcvd eow
debug2: channel 0: close_read
debug2: channel 0: input open -> closed
debug2: channel 0: rcvd close
debug2: channel 0: obuf_empty delayed efd 8/(22)
d not set up terminal
debug2: channel 0: written 22 to efd 8
debug2: channel 0: obuf empty
debug2: channel 0: close_write
debug2: channel 0: output drain -> closed
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Transferred: sent 2768, received 3708 bytes, in 0.2 seconds
Bytes per second: sent 13953.5, received 18692.1
debug1: Exit status 1
lost connection
@MVarga12: The most likely cause of this is that your fish configuration prints something even if it isn't interactive.
So please confirm that, on the remote machine, fish -c exit | wc -c prints 0. If it doesn't, you need to guard everything that prints in your config.fish with if status is-interactive.
@faho
The included command does indeed print 0 on the remote machine. Just to be sure, I systematically deleted lines from my config.fish file. The problem seems to be in the fish_vi_key_bindings command. Without this line, scp works properly. Included below is my config.fish file and an scp -vv output with bash as the default shell.
Activity
mqudsi commentedon Sep 27, 2017
You provided some configuration information, but it’s not clear which of the two PCs it pertains to. Is the remote machine running the same environment?
3xp10it commentedon Sep 27, 2017
Yes,both the two PCs has the same configuration.The configureation content is:
https://github.com/3xp10it/config.fish/blob/master/config.fish
zanchey commentedon Sep 27, 2017
Do you really run tmux on every start of a new shell?
If so, you need to protect that with:
See #3473.
3xp10it commentedon Sep 27, 2017
@zanchey I modify it to
And no more
open terminal failed: not a terminal TERM environment variable not set.error comes out,but after I have run the command:I found it didn't copy the file successfully,and I tried it 3 times,the result is the same.
zanchey commentedon Oct 1, 2017
Try running
scpwith-vvin order to get verbose output.faho commentedon Jan 1, 2018
Closing for lack of response. @3xp10it: If you would try
scp -vv, I'll gladly reopen.MVarga12 commentedon Apr 2, 2018
If I may, I'm also having this issue, and it was fixed when I changed the remote server's default terminal to bash. Attached is my scp -vv output, starting after successful authentication and hopefully scrubbed of server-identifying information.
faho commentedon Apr 4, 2018
@MVarga12: The most likely cause of this is that your fish configuration prints something even if it isn't interactive.
So please confirm that, on the remote machine,
fish -c exit | wc -cprints 0. If it doesn't, you need to guard everything that prints in your config.fish withif status is-interactive.Also, an scp log using bash would be of use.
Reopening!
MVarga12 commentedon Apr 4, 2018
@faho
The included command does indeed print 0 on the remote machine. Just to be sure, I systematically deleted lines from my config.fish file. The problem seems to be in the
fish_vi_key_bindingscommand. Without this line, scp works properly. Included below is my config.fish file and an scp -vv output with bash as the default shell.config.fish
scp output
zanchey commentedon Apr 4, 2018
Don't run
fish_vi_key_bindings, set the variable instead:MVarga12 commentedon Apr 4, 2018
Well that's embarrassing. All is well now. Thank you.
faq: add SSH/SFTP/SCP interactive guard suggestions