-
Notifications
You must be signed in to change notification settings - Fork 37
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
Use initial terminal size when creating a terminal #277
Conversation
When creating a terminal, queue the initial size of the terminal in the resize channel to ensure the terminal has correct dimensions upon opening. Signed-off-by: Angel Misevski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the PR following the provided steps and can't reproduce eclipse-che/che#22584.
Thanks @amisevsk for fixing it! 👍
@azatsarynnyy Great to hear, thanks! Sounds like you're not seeing the additional bug (terminal width is off by ~6 chars). I suspect that my still having the wrapping issue in testing is due to some font rendering weirdness on my system, given its consistency. What I think is happening is:
What I'm still not clear on is why this doesn't occur for the built in terminal, but if it's just a me problem then it might be fine to merge (this should fix the problem in the majority of cases, at least) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amisevsk I tested it more thoroughly and I noticed that the behavior is different depending on what container I opened the terminal to. See the screencast below:
Screen.Recording.2023-11-27.at.11.25.37.mov
Here ^^ I used the Java Sprint Boot
sample from the Dashboard.
Changing the editor image to quay.io/amisevsk/che-code:terminal-size
has no effect 🤷
This is the same issue I was facing. If you check the output tab for the Che Terminal plugin, you can see that the computed terminal width changes after it's initialized. For example, here I open a terminal (14 pt font, 129 columns, has wrapping issue), then change the font size to 16 and back to 14pt only to see the newest resize to be 136 columns (still 14pt font, panel width has not changed). terminal-width.mp4As far as I can tell, this is coming from somewhere within Code itself; I don't know if it's something we can fix. |
Testing it on my end, the mariaDB container also wraps correctly from the start, but the initial terminal size (e.g. 106 chars) is 6 less than the actual size (e.g. 112 chars). However, in the mariaDB container, it seems this wrapping is ignored? |
Build 3.12 :: machineexec_3.x/176: Console, Changes, Git Data |
Build 3.12 :: sync-to-downstream_3.x/6110: Console, Changes, Git Data |
Build 3.12 :: push-latest-container-to-quay_3.x/4269: Console, Changes, Git Data |
Build 3.12 :: get-sources-rhpkg-container-build_3.x/6006: machineexec : 3.x :: Build 58511050 : quay.io/devspaces/machineexec-rhel8:3.12-11 |
Build 3.12 :: update-digests_3.x/5713: Console, Changes, Git Data |
Build 3.12 :: machineexec_3.x/176: Upstream sync done; /DS_CI/sync-to-downstream_3.x/6110 triggered |
Build 3.12 :: operator-bundle_3.x/2590: Console, Changes, Git Data |
Build 3.12 :: sync-to-downstream_3.x/6111: Console, Changes, Git Data |
Build 3.12 :: push-latest-container-to-quay_3.x/4270: Console, Changes, Git Data |
Build 3.12 :: copyIIBsToQuay/2458: Console, Changes, Git Data |
Build 3.12 :: sync-to-downstream_3.x/6111: Build container: devspaces-operator-bundle synced; /DS_CI/get-sources-rhpkg-container-build_3.x/6007 triggered; /job/DS_CI/job/dsc_3.x triggered; |
Build 3.12 :: operator-bundle_3.x/2590: Upstream sync done; /DS_CI/sync-to-downstream_3.x/6111 triggered |
Build 3.12 :: dsc_3.x/1787: Console, Changes, Git Data |
Build 3.12 :: update-digests_3.x/5713: Detected new images: rebuild operator-bundle |
Build 3.12 :: dsc_3.x/1787: 3.12.0-CI |
Description
When creating a new terminal, queue the initial number of rows/columns in the resize channel after starting to ensure the terminal uses the correct initial size (this requires making the channel buffered).
This should fix eclipse-che/che#22584, except when testing it in the Code editor, the
initialDimensions
sent to machine-exec are wrong -- resizing the terminal pane by even a few pixels shows the new computed size is 7-9 characters wider.How to test
These changes are built into
quay.io/amisevsk/che-code:terminal-size
(with some additional logging to allow debugging terminal size issues).To test these changes: