Skip to content

Serial console width and resize issues #1447

Open

Description

@david-crespo

This issue is a bit vague, and I'll rename it when we figure it out better. There are a set of probably related issues that came up when @jmpesp was testing and demoing the streaming serial console.

Resize on window resize doesn't fully work. Once you load the serial console with a given window size, resizing the window does resize the terminal window displaying the stream, but the source doesn't seem to be aware of that. Now that I think about it that kind of makes sense? Once the text comes into the buffer in propolis from the VM itself, it's there, it's not gonna change width. Since multiple clients can connect to it, doesn't make sense for it to be dynamic. Most likely it is assuming a particular width and we should also assume that width. That means we may not need the fit addon at all. Instead we can just fix a particular width like 80 characters, and if the window gets smaller than that we'll have to scroll horizontally.

Need to figure out what to do about height as well, of course.

The starting tasks here are

  • Check hunch that propolis is assuming/forcing 80 character width on stream
  • Figure out how to get some realistic example data into the mock serial console so we can do dev easily

Activity

  1. lifning commented on Apr 10, 2023

    @lifning
    Contributor

    most OSes (including Linux) are going to assume by default that any serial console is 80 columns.

    normally when you resize your typical graphical terminal emulator, a SIGWINCH signal informs the processes within that the shape of the world has changed https://www.ietf.org/rfc/rfc1073.txt -- but obviously we can't just send a guest unix signals down a uart connection (even if such a thing were possible, it might not be a unix on the other end!)

    we may be able to blast some ANSI escape sequences back and forth (i.e. by running resize (typically found in the xterm (real (not javascript)) package) in the guest) so the guest can determine what the new window size should be, but live-resizing while an arbitrary program is running will get sticky.

  2. david-crespo commented on Apr 10, 2023

    @david-crespo
    CollaboratorAuthor

    Yeah, I think it's a lot safer and easier to assume 80 and not get fancy.

  3. changed the title [-]Serial console: resize doesn't quite work[/-] [+]Serial console width and resize issues[/+] on May 18, 2023
  4. david-crespo commented on May 18, 2023

    @david-crespo
    CollaboratorAuthor

    @mkeeter:

    If you do something like ps eax | less and page through it, the active region is clamped to 80x24, instead of the full screen size.

    (The same thing happens for vim)

    #1502

    The problem with using the full screen size is that there can be two people connected at the same time. Which screen size do you use? Most likely we will have to keep clamping.

  5. david-crespo commented on Jun 7, 2024

    @david-crespo
    CollaboratorAuthor

    Not sure if this is the same issue, will spin out a separate one if not. Thanks @taspelund for reporting.

    2024-06-07-serial-console-super-wide.mp4
  6. david-crespo commented on Jun 7, 2024

    @david-crespo
    CollaboratorAuthor

    The width problem in my comment is fixed by #2272. I don't think the original issue is fixed because it has to do with our app logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions