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 control codes for the console - std library for controlling the terminal #52

Open
fachat opened this issue Apr 15, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@fachat
Copy link
Owner

fachat commented Apr 15, 2020

Or at least some other recognized console codes (vt52?) so that it can be easily used when telnetting to other computers.

@fachat fachat added the enhancement New feature or request label Apr 15, 2020
@fachat fachat changed the title VT100 control codes for the console VT100 control codes for the console - std library for controlling the terminal Apr 15, 2024
@fachat
Copy link
Owner Author

fachat commented Apr 15, 2024

What would be a good, easy to implement set of control codes?

Should at least include:

  • cursor movement (left/right/up/down)
  • window definition (upper/left corner, lower right corner, clear window) [Note: not necessarily stacked windows. This could be done inside something like a term server - similar to tmux), or in a client-side lib - similar to curses]
  • clear screen (ff?), home, delete (right of cursor), backspace, (std definitions where available)
  • tab, cr, lf, bell, ... - standard definitions
  • option to ignore writes to the right of screen (instead of line breaking)? Or is this a client-side lib? If so, the client side lib needs to know the size of the screen....
  • feedback on the size of the screen, potentially other items (like key bindings?)

@fachat
Copy link
Owner Author

fachat commented Apr 15, 2024

  • scroll up / scroll down (full window)
  • set cursor position (obvious...)
  • delete a char / insert a char
  • delete a line at cursor, scrolling up below cursor (VT52)
  • inserting a line at cursor, scrolling down below cursor (Vt52)
  • set background, border colour
  • (graphics settings?)
  • set cursor color, cursor blink rate, on/off
  • set colour/blink/underline/reverse for text written
  • clear line, clear to start of line / screen, clear to end of line / end of screen (VT52)
  • mark / restore cursor position? (VT52)
  • move cursor multiple lines / chars u/d/l/r (VT100, or with set cursor from client?)
  • set tab (VT100 -> client side?)

http://www.6502.org/users/andre/petindex/keyboards.html#ctrl
https://toshyp.atari.org/en/VT_52_terminal.html
https://espterm.github.io/docs/VT100%20escape%20codes.html
http://www.bitsavers.org/pdf/wyse/WY-60/880261-01A_WY-60_Programmers_Guide_Jan87.pdf

@fachat
Copy link
Owner Author

fachat commented May 19, 2024

The currently supported control codes are defined here: https://github.com/fachat/GeckOS-V2/blob/master/include/tcdefs.i65

From the above list those are missing in the current implementation:

  • get feedback on screen / window size
  • scroll up/down full window
  • set background / border colours (text colours are available where the capability exists)
  • cursor can only be enabled / disabled, but not modified
  • clear whole line, clear to end of screen (clear to end of line exists)
  • move cursor multiple lines
  • set tabs

@fachat
Copy link
Owner Author

fachat commented May 19, 2024

The most reasonable one is getting feedback on the window size, which is basically necessary for editors if they don't want to rely on env variables or other kludges.

Scroll up/down whole screen, clear whole line, clear to end of screen look reasonably simple to implement with the given capabilities.

Relative cursor positioning would also be an option (move cursor multiple positions at once).
In this case it would also help if one could get feedback on actual cursor position.

@fachat
Copy link
Owner Author

fachat commented May 19, 2024

As I want to keep the actual device code simple and short, I'd actually prefer a user space lib (to be assembled into the actual program, or at some later point integrated with dynamic linking) that would convert VT52 (or other) codes to GeckOS control codes (and potentially vice versa)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant