Comments (5)
Okay, to clarify, I was in a read-only session. So I'd still call this unexpected.
upterm host --read-only zsh
from upterm.
I think I get what is the issue here. It works only when --force-command
isn't used. It also works for --read-only sessions.
How to reproduce:
- Run a host terminal
upterm host --read-only
in a terminal window. - Run a client terminal
ssh [email protected]
in another terminal window. - Terminate (close) the client terminal.
Expected: The host terminal do nothing dramatic (triggers ClientLeftCallback callback)
Actual: The host terminal exited with EOF error.
The reason for this behavior is the next few issues:
- Write and Read-only client terminals affects host terminal dimensions. issue #138
- When client terminal is terminated, it sends an event with width=0 and height=0 to host terminal. (https://github.com/owenthereal/upterm/blob/master/host/internal/server.go#L253).
- That cause host terminal to redraw.
- Redraw triggers a write operation to writers https://github.com/owenthereal/upterm/blob/master/host/internal/command.go#L127. It has 3 writers at this point (MultiWriter internal cache, host terminal stdout, remote session).
- Because remote session is already terminated that causes EOF error.
Possible ways to fix:
- Don't redraw the host terminal when the client terminal gets killed.
- Check session.Context().Done() somewhere (e.g. https://github.com/owenthereal/upterm/blob/master/host/internal/server.go#L195 ) that would trigger a dead writer to be removed here https://github.com/owenthereal/upterm/blob/master/host/internal/server.go#L242
- Handle writes to clients differently and ignore if they're broken/unstable. I believe that might also fix #134 but I didn't investigate that case.
from upterm.
What command did you run? For example, if you run bash
(e.g., upterm host -- bash
) and the client types exit
, the exit
is sent to the bash
command, and it will exit the bash process on the host. If you want that quitting client doesn't exit your host's running process, you would need a terminal multiplexer like tmux
. tmux
runs a server on the host, and quitting clients won't exit the tmux server on the host. For example, the following creates a tmux session on the host and forces clients to join by attaching to the tmux server: upterm host --force-command 'tmux attach -t pair-programming' -- tmux new -t pair-programming
(Ref: https://github.com/owenthereal/upterm#quick-reference)
from upterm.
Right, i was running just plain zsh. Somewhat unexpected but understandable.
from upterm.
This seems to not only happen when the last client leaves.
We can reproducibly bring upterm to terminate when any client of a read-only session closes (either with the SSH sequence [enter] ~ .
, or by closing the terminal window).
from upterm.
Related Issues (20)
- server uptermd.upterm.dev is not connectable in github action runner
- Client sessions change dimensions of host terminal. HOT 1
- "Server refuse our key" if upterm client lost time sync
- Bug: unknown flag: --vscode HOT 1
- Incompatibility with a running gpg-agent as ssh-agent?
- Support running host in daemon mode? HOT 1
- config file for `upterm host` command
- source labels on metrics
- feature request: upterm host should shutdown if no connection is established within a given time frame
- Support tunneling of commands
- Integration with zellij for "multiplayer" support? HOT 1
- uptermd with websockets: "FATA[0006] EOF" and "error waiting for pipe" error since 0.13.1 HOT 3
- Distribution-based package formats install binary at the wrong place HOT 1
- Restrict access to uptermd HOT 1
- Tmux fails to start, but only on macOS HOT 1
- "FLY_APP_NAME is not set" on upgrade HOT 1
- Upterm host doesn't work if there's no `id_rsa` keys in `~/.ssh` folder HOT 1
- "Waiting for upterm to be ready" failed with heroku server deploy
- Allow `upterm host` to authorise users on self-hosted versions of supported version control services
- Bug with `screen` splitting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from upterm.