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

VT100 compatible color mode not cleared #102

Open
grymoire opened this issue Sep 24, 2024 · 3 comments
Open

VT100 compatible color mode not cleared #102

grymoire opened this issue Sep 24, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@grymoire
Copy link
Contributor

When you connect to the BP, and enable VT100 compatible color mode, the bottom of the screen displays the voltages on the pins.

When you type "#" of "$" (reset, or boot mode), the BP disconnects, yet the terminal is not cleared. The voltages stayed displayed on the screen, even when you execute commands that could cause the screen to scroll down. It is necessary to type "clear" to reset the terminal.

@henrygab
Copy link
Collaborator

henrygab commented Sep 25, 2024

It would probably be good to define as a function, such as void ResetTerminalOnExit() or similar. Possible items which might be output to reset the terminal (did DEC/ANSI not provide a shortcut method?) might include:


Reset top/bottom margins

It appears that a scroll region is setup during initialization:

// set scroll region
printf("\e[%d;%dr", 1, system_config.terminal_ansi_rows - 4);

One site defines CSI #; # r as "set top/bottom margins". Documentation is sparse, but since default is to set to the viewport size, it's likely the sequence CSI ; r (omitting the numeric values) should reset to full size, regardless of terminal size.

As a C string, this would be: "\e[;r"?


Set cursor to bottom of screen

If getting rid of scroll area, don't want next output to overwrite the status bar information, as the user may want that to persist in the scrollback buffer.


Use other reset commands

CSI ? ###... l, where the ### can be one or more values to be reset:

### Meaning
1 Normal Cursor Keys
2 Designate VT52 mode
3 80 Column Mode
6 Normal Cursor Mode
7 No Wraparound Mode
8 No Auto-repeat Keys
9 Don’t send Mouse X & Y on button press
12 Stop Blinking Cursor
25 Hide Cursor
45 No reverse wrap-around
47 Use Normal Screen Buffer
66 Numeric keypad
1000 Don’t send Mouse reports
1002 Don’t use Cell Motion Mouse Tracking
1003 Don’t use All Motion Mouse Tracking
1004 Don’t send FocusIn/FocusOut events
1005 Disable UTF-8 Mouse Mode
1006 Disable SGR Mouse Mode
1015 Disable urxvt Mouse Mode
1016 Disable SGR-Pixels Mouse Mode
1047 Use Normal Screen Buffer (clearing screen if in alt)
1048 Restore cursor as in DECRC
1049 Use Normal Screen Buffer and restore cursor
2004 Reset bracketed paste mode

Output a single line

Output "\r\n" to force a single line scroll.


@wyattearp
Copy link
Contributor

It would probably be good to define as a function, such as void ResetTerminalOnExit() or similar. Possible items which might be output to reset the terminal (did DEC/ANSI not provide a shortcut method?) might include:

I'm going to second that it would be cool to have just a ResetTerminal() function. Numerous times I've wanted to type clear or reset and have it drop me back to the top of the screen like a standard bash prompt. This is also a present issue when entering / exiting the logic analyzer mode.

@wyattearp
Copy link
Contributor

Looking at the statemachine in #100, this appears to be related as well. I think it's probably best if we could sketch out the statemachine's intended execution and then create an update to address that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants