mobile-shell / mobile-shell/mosh
Suspending and killing mosh-client may not terminate sessions properly
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 14.5k
- Forks
- 865
- PR merge metrics
- No merged PRs in 30d
Description
Ideally, when you suspend the Mosh client with ^^ ^Z and kill it with kill %1, mosh-client would properly terminate, including sending a shutdown packet to the server to close the shell session. But on at least some systems (including my Mac and RPi), the kill causes mosh-client to exit immediately with tcsetattr: Input/output error. We should handle that error a little more gracefully.
Related: Currently our network code sends shutdown messages by setting a shutdown_in_progress state variable which tells the code to mark the next sent packet as a shutdown packet, and that packet may not get sent immediately. It might be good to have a synchronous method in the network code that immediately generates and sends a single shutdown packet, for situations where we don't want to wait for the full shutdown sequence.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the suspend-and-kill sequence described for mosh-client and inspect the client termination path where tcsetattr reports an input/output error. Then examine the network shutdown handling and its shutdown_in_progress state. Done means the client exits gracefully and sends a shutdown packet that closes the server-side shell session.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100