taviso / wpunix

WordPerfect for UNIX Character Terminals
603 stars 17 forks source link

xterm terminal type always selected #50

Open hackerb9 opened 2 months ago

hackerb9 commented 2 months ago

WordPerfect does not appear to be paying attention to my TERM or WPTERM environment variables and always selects terminal type "xterm". Is that how it is supposed to work?

I am testing wpunix on a genuine DEC VT340 and to get it to work I had to change the terminal type from the command line:

wp -t vt220 -g vt340_sixelhi

It does work. In fact it seems to work better than "xterm" which kept dying from segmentation faults when I was in the equation editor. But, it seems like wp is supposed to use TERM, no?

taviso commented 2 months ago

That's awesome, thanks for taking the photos!

Hmm, it is supposed to work, but as I usually only test on xterm compatible terminal I might have broken it - let me check. The equation editor also shouldn't crash, I thought I had it working.

There was also some feature that I needed to know what a real vt340 did, but I can't remember what it was - let me see if I can find my notes.

krackout commented 2 months ago

@hackerb9 I cannot get the results of screenshots wp80-dectermcolor-help1.jpg up to help4 (function keys layout). After pressing help (F3 key) twice I only get the cancel and undelete screen. I use xterm, are these screens available on physical terminal only?

PS: I tried wp -t vt220 -g vt340_sixelhi inside xterm but no function key pressed is recognized, I had to kill the process to exit. xterm -ti vt220 was the command to start xterm.

hackerb9 commented 2 months ago

I think you need to use xterm's vt220 keyboard setting so that you can use Ctrl + the function keys to get the keys beyond F12. On the DEC LK-201 keyboard (used by both the VT220 and VT340), the Help key is, I believe, F15.

image


Note: To temporarily turn on the VT220 keyboard in xterm, hold down control and the left mouse button to get to the menu. To enable it from the command line, try -kt vt220.

hackerb9 commented 2 months ago

PS. I just tested xterm -kt vt220 and PF1..PF4 are mapped to F1..F4.

CtrlF5 worked for me to get the help screen.

I think DECTerm presumed you'd be using a mouse so it has no menu accelerator. However, with wp -t vt220 -G vt340hi_sixel, you you can get the menu by PF3, =.

krackout commented 2 months ago

Very interesting, thank you. It worked for me also. Seems that on plain xterm the keyboard shortcuts are identical to MS-DOS WP5 - pity that they are not shown in menus or in keyboard template on double F3 press.

On 2024-04-14 01:40 hackerb9 @.***> wrote:

(PS. I just tested it and PF1..PF4 are mapped to F1..F4 in xterm -kt vt220. Looks like you can get the menu by PF3 =).

--
Reply to this email directly or view it on GitHub: https://github.com/taviso/wpunix/issues/50#issuecomment-2053782706 You are receiving this because you commented.

Message ID: @.***>

hackerb9 commented 2 months ago

I've created a file called vt340.trs based on vt220.trs but with better defaults for the VT340 terminal. (Correct name, correct font for line drawing characters, and correct graphics driver.) You can download it from https://github.com/hackerb9/vt340test/raw/main/sixeltests/wp/vt340.trs .

I notice that now that I have a "vt340" terminal type in shlib10, the wpterm program does use TERM=vt340 correctly. It is still ignored when running wp, but this is further evidence that maybe WordPerfect was supposed to use $TERM.

As a workaround, one can set the WPTERM environment variable.

These work:

wp -t vt340
WPTERM=vt340 wp

However, the xterm terminal type is still selected when I do this:

TERM=vt340 wp
hackerb9 commented 2 months ago

Very interesting, thank you. It worked for me also. Seems that on plain xterm the keyboard shortcuts are identical to MS-DOS WP5 - pity that they are not shown in menus or in keyboard template on double F3 press.

I was just reading the wpterm manual and it looks like you can add the keyboard shortcuts for xterm by setting the "Template Flag".