Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle terminal resize #7

Open
btwiuse opened this issue Jan 3, 2025 · 7 comments
Open

Handle terminal resize #7

btwiuse opened this issue Jan 3, 2025 · 7 comments
Labels
good first issue Good for newcomers

Comments

@btwiuse
Copy link

btwiuse commented Jan 3, 2025

Is your feature request related to a problem? Please describe.

Currently zasper web terminal doesn't resize to fit the window

Describe the solution you'd like

Make the terminal backend handle resize events emitted from the xterm.js frontend

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

  • Manually resize using the resize command
  • The terminal wire format currently in use comes from xterm-addon-attach, which is incompatible with https://github.com/jupyter/terminado used by Jupyter. Maybe zasper should move to the latter format

Additional context

Screenshot 2025-01-03 at 10 52 33
@prasunanand
Copy link
Member

Thanks @btwiuse for filing the issue. I am not using terminado for running Terminals.

Which OS are you using ? Are you running Zasper as an electron app or web app ?

@btwiuse
Copy link
Author

btwiuse commented Jan 3, 2025

I compiled it from source on macOS Sequoia 15.2 with latest master branch, started as a web app via ./zasper

Thanks @btwiuse for filing the issue. I am not using terminado for running Terminals.

Which OS are you using ? Are you running Zasper as an electron app or web app ?

@prasunanand prasunanand added the good first issue Good for newcomers label Jan 15, 2025
@prasunanand
Copy link
Member

Default shell for mac should be zsh detected on runtime. I am unable to reproduce on my mac Sequoia 15.1.1.

@btwiuse
Copy link
Author

btwiuse commented Jan 15, 2025

Actually this bug was also reproducible on any linux server.

I created a branch with .devcontainer.json, so you can directly view it in GitHub Codespace:

Open in GitHub Codespaces

Create a new workspace and wait ~5 minutes until zasper -debug runs

Screenshot 2025-01-16 05 40 33

Open the forwarded address, choose new terminal, open tmux in it, and resize browser window or the terminal

image

You can see the inner tmux window doesn't resize

@btwiuse
Copy link
Author

btwiuse commented Jan 15, 2025

As a side note I also changed the ui to use relative paths instead of hardcoded (http|ws)://localhost:8084 urls (btwiuse@d329ba3), otherwise the codespace reverse proxy won't rewrite the hostname automatically.

I believe the hardcoded hostname should be avoided in frontend ui. Maybe this deserves a separate issue

@prasunanand
Copy link
Member

As a side note I also changed the ui to use relative paths instead of hardcoded (http|ws)://localhost:8084 urls (btwiuse@d329ba3), otherwise the codespace reverse proxy won't rewrite the hostname automatically.

I believe the hardcoded hostname should be avoided in frontend ui. Maybe this deserves a separate issue

Thanks for pointing it out.

@prasunanand
Copy link
Member

Actually this bug was also reproducible on any linux server.
....
You can see the inner tmux window doesn't resize

Thanks @btwiuse , I will look into tmux support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants