-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Implement a Terminal Emulator #41
Comments
Reminder that the console-traits crate exists. |
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. |
That's a really interesting idea. Thanks! |
https://docs.rs/vte/0.11.1/vte/ is useful here. |
Started in #55 |
Need to think any how to share this Virtual Terminal object with the Application callbacks. |
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. |
Done in v0.5 |
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:
Our VGA/KB based terminal should work like a common serial terminal, like pyserial's microcom, or like PuTTY with its default configuration.
The text was updated successfully, but these errors were encountered: