magiblot / tvision

A modern port of Turbo Vision 2.0, the classical framework for text-based user interfaces. Now cross-platform and with Unicode support.
Other
2.04k stars 152 forks source link

Fixes build when opt. dependency GPM is missing. #8

Closed raulcostajunior closed 4 years ago

raulcostajunior commented 4 years ago

Magiblot, thanks for the fantastic work on Turbo Vision.

I didn't have the 'gpm' optional dependency on my system (a Ubuntu 20.04). In this scenario, a compilation error happens on line 96 of 'gpminput.ccp'.

This pull request contains a possible fix for the problem.

magiblot commented 4 years ago

Hi Raul Costa, thank you very much for giving this a try. I will submit a proper fix later. Please let me know if you run across any other issues!

raulcostajunior commented 4 years ago

Sure, I will contact you if I come across any other issue. Thanks!

magiblot commented 4 years ago

Fixed. Did you manage to get it to work?

raulcostajunior commented 4 years ago

I'll update and take a look.

What I did yesterday was to install 'gpm' to fulfill the optional dependency and gave it a try. I noticed that after the Tvision application had been executed the mouse operations did not work anymore on the specific terminal instance - any selection I tried to do with the mouse cursor ended up echoing characters in the terminal instead of highlighting the selection. I was using Ubuntu 20.04.

I'll let you know more after I update.

magiblot commented 4 years ago

Unless you had to change other parts of the code, updating will probably change nothing, as the commit fixes a compilation issue but does not change the program's behaviour.

What you are experiencing usually happens when Turbo Vision exits abruptly due to a signal, in which case it is unable to restore the terminal status, but that is not the case here. A workaround for this is to open another terminal application (nano, tilde, etc.) and close it, and then the terminal status should have been restored.

The most feasible reason (as I can reproduce locally with urxvt, terminology and kitty) is that ncurses doesn't support your terminal well. Comment out lines 47 to 52 here: https://github.com/magiblot/tvision/blob/master/source/linux/ncursinp.cpp#L47. That will fix the issue but you won't be able to drag with the mouse. You can try other terminal emulators: Turbo Vision has good mouse support in konsole and xterm.

raulcostajunior commented 4 years ago

Thanks for the information, magiblot.

I'll try the fix (and the workaround) you suggested. Maybe the fix is good enough for my intended use case: a text mode data explorer for InfluxDb.

I'm using the default gnome-terminal in Ubuntu 20.04. I'll try to find out more about ncurses support for it.

magiblot commented 4 years ago

Nevermind, last commit fixes it.