Abnormal Disconnect on Ctrl+C

Hello,
I understand some bugs were fixed around this issue of "Abnormal Disconnect" but i still get it when i do a "Ctrl + C" everytime!

Hi Paul, I'm sorry about the issue. What happens if you press "Ctrl + C" in Terminal.app after connect via ssh command line?

it ends the current running process, and i am still connected so i can do more commands.

I could not reproduced the issue, is it happens on all your hosts or just a specific one? And could you please enable debug log and paste the log here? Don't forget eliminate sensitive information from the log.

## Backend ##
----------------------------------------
Equivalent Command: ssh -vvv -o ExitOnForwardFailure=yes -o ServerAliveCountMax=3 -o ServerAliveInterval=15 -o RemoteCommand="cd web/backend;adonis serve --dev" dev@192.168.1.31
10:54:33 Connecting…
10:54:33 Using Core Helper 4.4 (r44)
10:54:33 OpenSSH_8.0p1, OpenSSL 1.0.2s 28 May 2019
10:54:33 debug1: Reading configuration data /Users/paul/.ssh/config
10:54:33 debug1: Reading configuration data /etc/ssh/ssh_config
10:54:33 debug1: /etc/ssh/ssh_config line 48: Applying options for *
10:54:33 debug2: resolve_canonicalize: hostname 192.168.1.31 is address
10:54:33 debug3: expanding RemoteCommand: cd web/backend;adonis serve --dev
10:54:33 debug3: expanded RemoteCommand: cd web/backend;adonis serve --dev
10:54:33 debug2: ssh_connect_direct
10:54:33 debug1: Connecting to 192.168.1.31 [192.168.1.31] port 22.
10:54:33 debug1: Connection established.
10:54:33 debug1: identity file /Users/paul/.ssh/id_rsa type 0
10:54:33 debug1: identity file /Users/paul/.ssh/id_rsa-cert type -1
10:54:33 debug1: identity file /Users/paul/.ssh/id_dsa type -1
10:54:33 debug1: identity file /Users/paul/.ssh/id_dsa-cert type -1
10:54:33 debug1: identity file /Users/paul/.ssh/id_ecdsa type -1
10:54:33 debug1: identity file /Users/paul/.ssh/id_ecdsa-cert type -1
10:54:33 debug1: identity file /Users/paul/.ssh/id_ed25519 type -1
10:54:33 debug1: identity file /Users/paul/.ssh/id_ed25519-cert type -1
10:54:33 debug1: identity file /Users/paul/.ssh/id_xmss type -1
10:54:33 debug1: identity file /Users/paul/.ssh/id_xmss-cert type -1
10:54:33 debug1: Local version string SSH-2.0-OpenSSH_8.0
10:54:33 debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
10:54:33 debug1: match: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
10:54:33 debug2: fd 3 setting O_NONBLOCK
10:54:33 debug1: Authenticating to 192.168.1.31:22 as 'dev'
10:54:33 debug3: hostkeys_foreach: reading file "/Users/paul/.ssh/known_hosts"
10:54:33 Authenticating…
10:54:33 debug3: record_hostkey: found key type ECDSA in file /Users/paul/.ssh/known_hosts:1
10:54:33 debug3: load_hostkeys: loaded 1 keys from 192.168.1.31
10:54:33 debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
10:54:33 debug3: send packet: type 20
10:54:33 debug1: SSH2_MSG_KEXINIT sent
10:54:33 debug3: receive packet: type 20
10:54:33 debug1: SSH2_MSG_KEXINIT received
10:54:33 debug2: local client KEXINIT proposal
10:54:33 debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
10:54:33 debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
10:54:33 debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
10:54:33 debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
10:54:33 debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
10:54:33 debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
10:54:33 debug2: compression ctos: none,zlib@openssh.com,zlib
10:54:33 debug2: compression stoc: none,zlib@openssh.com,zlib
10:54:33 debug2: languages ctos:
10:54:33 debug2: languages stoc:
10:54:33 debug2: first_kex_follows 0
10:54:33 debug2: reserved 0
10:54:33 debug2: peer server KEXINIT proposal
10:54:33 debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
10:54:33 debug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
10:54:33 debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
10:54:33 debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
10:54:33 debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
10:54:33 debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
10:54:33 debug2: compression ctos: none,zlib@openssh.com
10:54:33 debug2: compression stoc: none,zlib@openssh.com
10:54:33 debug2: languages ctos:
10:54:33 debug2: languages stoc:
10:54:33 debug2: first_kex_follows 0
10:54:33 debug2: reserved 0
10:54:33 debug1: kex: algorithm: curve25519-sha256
10:54:33 debug1: kex: host key algorithm: ecdsa-sha2-nistp256
10:54:33 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
10:54:33 debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
10:54:33 debug3: send packet: type 30
10:54:33 debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
10:54:33 debug3: receive packet: type 31
10:54:33 debug3: hostkeys_foreach: reading file "/Users/paul/.ssh/known_hosts"
10:54:33 debug3: record_hostkey: found key type ECDSA in file /Users/paul/.ssh/known_hosts:1
10:54:33 debug3: load_hostkeys: loaded 1 keys from 192.168.1.31
10:54:33 debug1: Host '192.168.1.31' is known and matches the ECDSA host key.
10:54:33 debug1: Found key in /Users/paul/.ssh/known_hosts:1
10:54:33 debug3: send packet: type 21
10:54:33 debug2: set_newkeys: mode 1
10:54:33 debug1: rekey out after 134217728 blocks
10:54:33 debug1: SSH2_MSG_NEWKEYS sent
10:54:33 debug1: expecting SSH2_MSG_NEWKEYS
10:54:33 debug3: receive packet: type 21
10:54:33 debug1: SSH2_MSG_NEWKEYS received
10:54:33 debug2: set_newkeys: mode 0
10:54:33 debug1: rekey in after 134217728 blocks
10:54:33 debug1: Will attempt key: /Users/paul/.ssh/id_dsa
10:54:33 debug1: Will attempt key: /Users/paul/.ssh/id_ecdsa
10:54:33 debug1: Will attempt key: /Users/paul/.ssh/id_ed25519
10:54:33 debug1: Will attempt key: /Users/paul/.ssh/id_xmss
10:54:33 debug2: pubkey_prepare: done
10:54:33 debug3: send packet: type 5
10:54:33 debug3: receive packet: type 7
10:54:33 debug1: SSH2_MSG_EXT_INFO received
10:54:33 debug3: receive packet: type 6
10:54:33 debug2: service_accept: ssh-userauth
10:54:33 debug1: SSH2_MSG_SERVICE_ACCEPT received
10:54:33 debug3: send packet: type 50
10:54:33 debug3: receive packet: type 51
10:54:33 debug1: Authentications that can continue: publickey,password
10:54:33 debug3: start over, passed a different list publickey,password
10:54:33 debug3: preferred publickey,keyboard-interactive,password
10:54:33 debug3: authmethod_lookup publickey
10:54:33 debug3: remaining preferred: keyboard-interactive,password
10:54:33 debug3: authmethod_is_enabled publickey
10:54:33 debug1: Next authentication method: publickey
10:54:33 debug3: send packet: type 50
10:54:33 debug2: we sent a publickey packet, wait for reply
10:54:33 debug3: receive packet: type 60
10:54:33 debug3: sign_and_send_pubkey: signing using rsa-sha2-512
10:54:34 debug3: send packet: type 50
10:54:34 debug3: receive packet: type 52
10:54:34 debug1: Authentication succeeded (publickey).
10:54:34 Authenticated to 192.168.1.31 ([192.168.1.31]:22).
10:54:34 debug2: fd 4 setting O_NONBLOCK
10:54:34 debug2: fd 5 setting O_NONBLOCK
10:54:34 debug2: fd 6 setting O_NONBLOCK
10:54:34 debug1: channel 0: new [client-session]
10:54:34 debug3: ssh_session2_open: channel_new: 0
10:54:34 debug2: channel 0: send open
10:54:34 debug3: send packet: type 90
10:54:34 debug1: Requesting no-more-sessions@openssh.com
10:54:34 debug3: send packet: type 80
10:54:34 debug1: Entering interactive session.
10:54:34 debug1: pledge: network
10:54:34 debug2: fd 7 setting O_NONBLOCK
10:54:34 debug2: fd 8 setting O_NONBLOCK
10:54:34 Connected
10:54:34 debug2: client_check_window_change: changed
10:54:34 debug3: receive packet: type 80
10:54:34 debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
10:54:34 debug3: receive packet: type 91
10:54:34 debug2: channel_input_open_confirmation: channel 0: callback start
10:54:34 debug2: fd 3 setting TCP_NODELAY
10:54:34 debug3: ssh_packet_set_tos: set IP_TOS 0x48
10:54:34 debug2: client_session2_setup: id 0
10:54:34 debug2: channel 0: request pty-req confirm 1
10:54:34 debug3: send packet: type 98
10:54:34 debug1: Sending environment.
10:54:34 debug3: Ignored env TMPDIR
10:54:34 debug3: Ignored env SHELL
10:54:34 debug3: Ignored env HOME
10:54:34 debug3: Ignored env SSH_AUTH_SOCK
10:54:34 debug3: Ignored env Apple_PubSub_Socket_Render
10:54:34 debug3: Ignored env LOGNAME
10:54:34 debug3: Ignored env PATH
10:54:34 debug3: Ignored env XPC_SERVICE_NAME
10:54:34 debug3: Ignored env USER
10:54:34 debug3: Ignored env XPC_FLAGS
10:54:34 debug3: Ignored env __CF_USER_TEXT_ENCODING
10:54:34 debug3: Ignored env INTERACTION
10:54:34 debug3: Ignored env DISPLAY
10:54:34 debug3: Ignored env TERM
10:54:34 debug3: Ignored env SSH_ASKPASS
10:54:34 debug3: Ignored env OBJC_DISABLE_INITIALIZE_FORK_SAFETY
10:54:34 debug3: Ignored env CFFIXED_USER_HOME
10:54:34 debug3: Ignored env APP_SANDBOX_CONTAINER_ID
10:54:34 debug1: Sending command: cd web/backend;adonis serve --dev
10:54:34 debug2: channel 0: request exec confirm 1
10:54:34 debug3: send packet: type 98
10:54:34 debug2: channel_input_open_confirmation: channel 0: callback done
10:54:34 debug2: channel 0: open confirm rwindow 0 rmax 32768
10:54:34 debug3: receive packet: type 99
10:54:34 debug2: channel_input_status_confirm: type 99 id 0
10:54:34 debug2: PTY allocation request accepted on channel 0
10:54:34 debug2: channel 0: rcvd adjust 2097152
10:54:34 debug3: receive packet: type 99
10:54:34 debug2: channel_input_status_confirm: type 99 id 0
10:54:34 debug2: exec request accepted on channel 0
10:54:47 debug3: receive packet: type 98
Connection to 192.168.1.31 closed.
10:54:47 debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
10:54:47 debug3: receive packet: type 98
10:54:47 debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
10:54:47 debug2: channel 0: rcvd eow
10:54:47 debug2: channel 0: chan_shutdown_read (i0 o0 sock -1 wfd 4 efd 6 [write])
10:54:47 debug2: channel 0: input open -> closed
10:54:47 debug3: receive packet: type 96
10:54:47 debug2: channel 0: rcvd eof
10:54:47 debug2: channel 0: output open -> drain
10:54:47 debug2: channel 0: obuf empty
10:54:47 debug2: channel 0: chan_shutdown_write (i3 o1 sock -1 wfd 5 efd 6 [write])
10:54:47 debug2: channel 0: output drain -> closed
10:54:47 debug3: receive packet: type 97
10:54:47 debug2: channel 0: rcvd close
10:54:47 debug3: channel 0: will not send data after close
10:54:47 debug2: channel 0: almost dead
10:54:47 debug2: channel 0: gc: notify user
10:54:47 debug2: channel 0: gc: user detached
10:54:47 debug2: channel 0: send close
10:54:47 debug3: send packet: type 97
10:54:47 debug2: channel 0: is dead
10:54:47 debug2: channel 0: garbage collecting
10:54:47 debug1: channel 0: free: client-session, nchannels 1
10:54:47 debug3: channel 0: status: The following connections are open:
#0 client-session (t4 r0 i3/0 o3/0 e[write]/0 fd -1/-1/6 sock -1 cc -1)
10:54:47 debug3: send packet: type 1
10:54:47 debug1: fd 0 clearing O_NONBLOCK
10:54:47 debug3: fd 1 is not O_NONBLOCK
10:54:47 debug1: fd 2 clearing O_NONBLOCK
10:54:47 Transferred: sent 3060, received 2964 bytes, in 13.8 seconds
10:54:47 Bytes per second: sent 221.4, received 214.4
10:54:47 debug1: Exit status 0
10:54:47 Disconnected

Hi Paul, thanks a lot for the debug log, will investigate this issue ASAP.