taviso / 123elf

A native port of Lotus 1-2-3 to Linux.
1.18k stars 59 forks source link

Key bindings for DEC VT-320 terminal #38

Open sblendorio opened 2 years ago

taviso commented 2 years ago

Thanks, this is fun! I wonder if I can just automate it though, if TERM=vt320, can I just send those strings in main() and it will work?

taviso commented 2 years ago

Untested, but I'm thinking of something like this in main()?

if (strcmp(getenv("TERM"), "vt320") == 0) {
      setenv("TERM, "vt100", 1);
      fwrite(""\eP1;1;1|33/1b5b363b357e\e\\", xx, 1, stdout);
}
sblendorio commented 2 years ago

I did it in this new commit. I used printf() because fwrite() - also with fflush() - did not write anything on the terminal.

taviso commented 2 years ago

The patch looks good to me! I copied your note to the wiki too:

https://github.com/taviso/123elf/wiki/Terminals

I've noticed there is a built-in keymap called "vtxxx", but I don't know what it does, I just want to check that isn't better than vt100 for some terminals before overwriting it!

sblendorio commented 2 years ago

Do you think it's possibile to control PF3 and PF4 keys through your patch? Both original VT100 and VT320 got PF3 and PF4, while F20 and F19 are absent on VT100

sblendorio commented 2 years ago

"vtxxx" is a binary file labeled as "PDP-11 UNIX/RT ldp", never heard about that...

image

Hard to find infos about that format