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

Mouse movement in binl/vi produces garbage #1263

Open
winspool opened this issue Apr 1, 2024 · 10 comments
Open

Mouse movement in binl/vi produces garbage #1263

winspool opened this issue Apr 1, 2024 · 10 comments
Labels

Comments

@winspool
Copy link
Contributor

winspool commented Apr 1, 2024

I tried with my own build and the ci build from yesterday.
In addition to the default distribution terminal,
i re-installed and tested term (the bug is always the same).

To reproduce:

cd $WATCOM
binl/vi  readme.txt

When i now move the mouse over the terminal window, vi changes from command mode to
insert mode and overwrites the first line by inserting bogus characters.
This happens on the first mouse move. Additional mouse moves do not change the content.
Switching back to command mode and moving the mouse again inserts again bogus characters
(as before, only on the first mouse move).

When vi is in command mode and I press the ":" key,
the command line window pops up with the column printed as the first character,
but on all mouse moves over the vi window, the commandline is filled with many bogus characters.

The bug is only present in the binl/viprogram compiled by OpenWatcom.
binl64/vi (compiled with gcc 13) does not have this bug.
I also used wine to check binnt\vi.exe and binnt64\vi.exe, and both does not have this bug.

Example Screenshoot:
https://imgur.com/bhY1IAv.png

@jmalak jmalak added the bug label Apr 1, 2024
@jmalak
Copy link
Member

jmalak commented Apr 1, 2024

it looks like bug in Linux 32-bit version, which uses OW ncurses port.

Could be related to ported ncurses version 5.3 and its compatibility with ncurses version used by up-to-date Linux distribution.
OW has port of ncurses version 5.3 with a modifications to works with older ABI versions, but current ncurses version is 6.4 with new ABI version. it is only hypothesis and issue need more investigation.

@winspool
Copy link
Contributor Author

winspool commented Apr 1, 2024

it looks like bug in Linux 32-bit version, which uses OW ncurses port.

When i tried the Linux console (VT1) before and on the VT,
the window borders and all menues are total garbage.
($TERM in a VT is the same as in an x terminal emulator: xterm-256color)

Could be related to ported ncurses version 5.3
OW has port of ncurses version 5.3 with a modifications to works with older ABI versions,
but current ncurses version is 6.4 with new ABI version.

Can you remember, what was changed / which ABI`s are different?

it is only hypothesis and issue need more investigation.

When i can help, please tell me, what should i do, to help here.

@winspool
Copy link
Contributor Author

winspool commented Apr 1, 2024

A photo from VT1

IMG_20240401_142908

@jmalak
Copy link
Member

jmalak commented Apr 1, 2024

Try it with more classics terminal as VT-100, VT-220 or VT-420

@winspool
Copy link
Contributor Author

winspool commented Apr 3, 2024

I did an update of bld/ncurses to
ncurses-6.4-20240330 (latest dev) but the bug is still present

Try it with more classics terminal as VT-100, VT-220 or VT-420

Without the minus sign in the terminal names,
all three suggested terminal modes create correct menus
but without colors and without mouse support.

On the mouse move, there is no switch to insert mode
and no insertion of bogus characters.

More results:
xterm-color: broken as xterm-256color

xtermc: menu drawing is correct,
program does not react on cursor keys
bogus characters on mouse movement

@winspool
Copy link
Contributor Author

winspool commented Apr 3, 2024

This is an archive from my ncurses update.

What i did:

  • save current ncurses code in the c_5.3 and h_5.3 dirs
  • copy files from ncurses-6.4-20240330 (latest dev),
    which where already used in ncurses-5.3
  • rename files to short names
  • try wmake in bld/ncurses/linux386 (or bld/ncurses/linuxx64`)
  • adjust filesnames in the source, comment out missing includes, fix warnings
  • for missing structs / types / defines, find them in the ncurses 6.4 source
    and add needed files to bld/ncurses.
  • change "#include" to the new short names
    (might result in re-activate includes)
  • repeat until bld/ncurses/linux386 and bld/ncurses/linuxx64 build
  • repeat by building bld/ui/unix/linux386 and bld/ui/unix/linuxx64
  • repeat by building bld/vi/linux386 and bld/vi/linuxx64
  • repeat by building linux386 and linuxx64 in
    bld/wv/linux, bld/setupgui and bld/wprof

This works for now, but is not perfect:

  • bld/ncurses/readme.txt and any other documentation is not updated yet
  • Need to check more projects, which use bld/ncurses or bld/ui (do they exist?)
  • ncurses has a multi-screen extension, which I deactivated late

TODO: upgrade bld/ncurses after the next ncurses release,
while deactivating as much as possible during configure
since some files are generated during configure.
(use owcc -blinux and gcc -m32 as toolchains)
(gcc -m32 is required, because owcc fails to build ncurses)

ncurses_6.4_try1.tar.gz

@jmalak
Copy link
Member

jmalak commented Apr 3, 2024

If I can do conclusion then bug is somewhere in OW code.
Update ncurses should fix some issues with newer terminals on latest distributions which use ncurses 6, but need review because OW use old code for terminals.
For review we need somebody with terminal application development knowledge.
Anyway best should be first fix OW code bug then update ncurses.

@winspool
Copy link
Contributor Author

winspool commented Apr 4, 2024

As mentioned in bug #1265, there are also garbage characters in wd,
but the bogus characters in wd are inserted when using the mousewheel
or when using the curser-up / cursor-down keys.

I have no idea, if it's the same bug.

Screenshoot: I used "cursor-up" in the same column multiple times.
The garbage characters are always the same.
https://imgur.com/dE6nsmj.png

@jmalak
Copy link
Member

jmalak commented Apr 4, 2024

I just tested it on Debian 12 with downloaded latest build and it works without any problem.

@winspool
Copy link
Contributor Author

winspool commented Apr 8, 2024

I just tested it on Debian 12 with downloaded latest build and it works without any problem.

Strange.

I found a Debian 12.4 machine (Kernel 6.1.0-11-amd64) in the compile farm: cfarm14.cfarm.net
and tested with the latest ci build:
binl/vi readme.txt: Garbage chracters, as reported in this issue
binl64/vi readme.txt: No garbage characters

I have still no idea, why the 64bit version works and the 32bit version is broken,
and why you can't reproduce it yet.
Which 64bit compiler/version is used for the binl64 ci build?

What is the value of your $TERM?

Since i used ssh to connect to cfarm14,
the $TERM comes from my machine, and it's still the default of my OS:
"xterm.256color"

Which terminal emulator do you use?
I tested xfce4-terminal 1.0.4 (Xfce 4.18) and XTerm(384)
and binl/viis broken on both terminal emulator.

Currently, my system uses kernel 6.7.11 x86_64

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

No branches or pull requests

2 participants