microsoft / microsoft/terminal

nohup process terminates when terminal disconnects from ssh session

Open
#17,999 5 comments 0 reactions 0 assignees View on GitHub
Issue-Bug Needs-Repro Needs-Tag-Fix Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### Windows Terminal version

1.20.11781.0

### Windows build number

10.0.22631.4169

### Other Software

_No response_

### Steps to reproduce

1. ssh to a remote machine from the Windows terminal
2. run a program (e.g., a node process that spins up a server listening to connections) like `nohup npm run &`

leave terminal connected. after some period of inactivity (could be few hours) terminal will disconnect (broken pipe) as machine could go to sleep etc.

When this happens the program you started on the remote machine also terminates.

### Expected Behavior

program you started on the remote machine should keep running.

### Actual Behavior

program you started on the remote machine terminates. _Note this does not happen if you exit from the ssh session by typing the `exit` command vs. leaving the terminal connected and it disconnects due to inactivity_. if it helps, on Mac (with iTerm), the problem does not happen when leaving the terminal connected and it disconnects due to inactivity

Contributor guide

Open the contributing guide

Research direction

Reproduce the SSH scenario from the issue by running a long-lived command such as a nohup Node process, then compare a broken-pipe disconnect with an explicit exit. Investigate Windows Terminal's handling of the disconnected SSH session; done means the remote process remains running after inactivity causes the terminal connection to close.

Written by the indexing model from the issue text.

Assessment

Domain
cli, networking, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.