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

Use curses to support non-vt100 terminals? (request) #24

Open
wyatt8740 opened this issue Jul 14, 2016 · 4 comments
Open

Use curses to support non-vt100 terminals? (request) #24

wyatt8740 opened this issue Jul 14, 2016 · 4 comments

Comments

@wyatt8740
Copy link

I have an IBM 3161 ASCII terminal. The point of using curses is to make your programs terminal-independent. I think it'd be a very good idea to add it (though I understand this may push the 'lines of code' up a lot).

Image of IBM 3161 ASCII Display Station

If your intention is portability, curses is the way to go. VT100 codes are not universal, although they are common. The 3161 doesn't emulate a VT100 either; it emulates the ADDS Viewpoint, ADM-3A, ADM-5, Hazeltine 1500, IBM 3101, and TeleVideo 910. None of those are VT100 compatible.

Alternately, a method to manually supply alternate escape codes would be good.

@flying-sheep
Copy link

flying-sheep commented Sep 14, 2017

Alternately, a method to manually supply alternate escape codes would be good.

i think this would be the way to go. like

#ifndef _KILO_ESCAPES
#define _KILO_ESCAPES
#define ESC_GO_RIGHT(n) ("\x1b[" #n "C")
#define ESC_GO_RIGHT(n) ("\x1b[" #n "B")
#endif

and then in the code:

/* Go to right/bottom margin and get position. */
if (write(ofd, ESC_GO_RIGHT(999) ESC_GO_DOWN(999), <calc length>) != 12) goto failed;

and if you want to override, just do $(CC) -o kilo my_term_escapes.c kilo.c …

@wyatt8740
Copy link
Author

This'd probably work, I'll try it.
(Not sure why people are "thumbs-downing" more compatibility...)

@erf
Copy link

erf commented Sep 16, 2017

I believe this project is just a fun, proof-of-concept minimal text editor, which can be used to build on. Also if you look at the commit log you can see there are no updates since Jul 10, 2016, even with smaller pull requests, so i doubt curses will be added ..

@flying-sheep
Copy link

I believe this project is just a fun, proof-of-concept minimal text editor, which can be used to build on

yeah, that’s probably the idea. this project is about seeing what’s going on. ncurses is too “magic” for this project.

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

No branches or pull requests

3 participants