14

Writing a truly crossplatform terminal library is the biggest pain in the ass.

And you thought windows was bad. They have a proper API with droves of features, freely allocatable screenbuffers, scrolling on both axes, etc.
Fucking xterm vtxxx compatible piles of shit are the problem.
Controlling kinda works eventhough the feature set is pretty bad. The really fucked up thing is reading values back. They literally get put into the input buffer. So you have to read all the actual user input before that and then somehow parse out the returned control sequence. Of course the user input has to be consumed so I have to buffer it myself. Even better is when you get a response with non printable characters which the fucking terminal will interpret as another control sequence. So when you set a window title to a ansi control sequence it would get executed when queried. Fuck this shit but I'm not giving up. I will tame this ugly, bodged together dragon

Comments
  • 3
    Well unix has "curses", with versions for Windows.
  • 1
    @sbiewald I'm considering using ncurses instead of raw ansi stuff but I fear that it's a.) also a burning pile of garbage and .b) doesn't provide the low level functionality I need for my terminal abstraction
  • 0
    Actually I doubt I can use curses because I need cross compilation, i.e. running curses on windows with an ansi terminal
  • 0
    @12bitfloat Windows supports ANSI escape sequences, but you have to enable them manually with a Win32 call.
  • 0
    @sbiewald Only powershell on win10 IIRC. But that's not the problem anyways, the windows console api works beautifully
  • 1
    Why is it so bad?
    Entrenched legacy cruft? Bleh.
  • 1
    @Root Nothing is standardized and everything is shit in it's own way. As if dealing with *one* outdated abortion of an interface wasn't already bad enough...
Add Comment