Skip to content

[Enhancement] Expose terminal cursor #2394

Open
@Garek33

Description

I propose the following additions (and would be willing to implement them after christmas):

  • Expose the terminal cursor as additional suffixes of terminal
    • cursorcol
      • get returns ScreenBuffer.CursorColumn
      • set calls ScreenBuffer.MoveCursor(ScreenBuffer.CursorRow, arg)
    • cursorrow
      • get returns ScreenBuffer.CursorRow
      • set calls ScreenBuffer.MoveCursor(arg, ScreenBuffer.CursorColumn)
  • Create a way to print a string at the current cursor, moving the cursor, but without the newline appended by print
    • How about put? Traditionally, that would only output a character, but kOS doesn't differentiate between the two anyway
      • Even if this becomes a suffix of terminal, I'm against calling it print to avoid confusion.
    • as a builtin or as a suffix for terminal?
      • a builtin would fit with print and print at being builtins
      • a suffix for terminal would avoid increasing the number of builtins potentially colliding with user identifiers. I could create println and printat suffixes as well to keep consistency (keeping the print builtins obviously, because we don't want to break everything)

This would enable user build prompts to play nice with regular print output. Also, this would enable a user to work around problems like #1007. On a personal note, I want to get into kOS plugin development, and these additions would be useful for a kerboscript project of mine.

(Why not build a script-side screenbuffer using print at for output? Because then any script that wants to print output needs to know and use that because regular print would mangle it. And I'm trying to limit interdependencies like that.)

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