You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Terminal Emulator will interpret ANSI sequences and draw on the text buffer appropriately.
If the serial terminal is enabled, they are passed straight through.
The OS will also handle "raw" and "cooked" mode. Cooked mode only supplies a line to the application after Enter is pressed. Line editing (backspace, etc) is done before they application sees the string. Raw mode supplies each character as it is received (as UTF-8 encoded bytes), backspace and all. You can use an I/O Control (ioctl) to change modes. The raw/cooked is in the OS and will work with either terminal (VGA/KB or Serial).
Function Keys and other special characters would be sent to the application as ANSI strings.
Note to self: need to have a timeout ioctl so you can make read calls timeout if nothing has been received otherwise you could lock a program up, and it can't do anything whilst waiting for keys.
Examples of programs using raw mode:
games like snake or tetris
a full screen editor
Our VGA/KB based terminal should work like a common serial terminal, like pyserial's microcom, or like PuTTY with its default configuration.
Also, what happens if you have serial and VGA terminals and the application asks for the screen size? Who responds? Both? Only serial? What if serial isn't connected?
Maybe you can only pick one, but you can hold V on startup for VGA mode, or blast S over serial for serial mode. But I guess that involves getting the UART working.
One way to handle this (not necessarily a good way) is to assign the terminal with first input as console or "active" terminal. If you want to use both (but not simultaneously) you just update the console attribute whenever you get input from one of them.
Activity
thejpster commentedon May 24, 2023
Reminder that the console-traits crate exists.
thejpster commentedon May 24, 2023
Also, what happens if you have serial and VGA terminals and the application asks for the screen size? Who responds? Both? Only serial? What if serial isn't connected?
Maybe you can only pick one, but you can hold V on startup for VGA mode, or blast S over serial for serial mode. But I guess that involves getting the UART working.
tingox commentedon Jul 4, 2023
One way to handle this (not necessarily a good way) is to assign the terminal with first input as console or "active" terminal. If you want to use both (but not simultaneously) you just update the console attribute whenever you get input from one of them.
thejpster commentedon Jul 5, 2023
That's a really interesting idea. Thanks!
thejpster commentedon Jul 13, 2023
https://docs.rs/vte/0.11.1/vte/ is useful here.
thejpster commentedon Jul 15, 2023
Started in #55
thejpster commentedon Jul 17, 2023
Need to think any how to share this Virtual Terminal object with the Application callbacks.
thejpster commentedon Jul 20, 2023
Wrote a refcell that uses the bios to provide a critical section. Used this for standard input and for console output.
ANSI decoder handles colours, cursor on/off, and basic position updates, so that's enough for this ticket.
jonathanpallant commentedon Jul 21, 2023
Done in v0.5