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
KDE Konsole doesn't seem to respond to "get screen size" escape sequence #48
Comments
Exactly, as you don't say what you use, it's hard to say what's going on. Please see https://www.chiark.greenend.org.uk/~sgtatham/bugs.html . |
First of all, it's not even a bug report (yet). I'm trying to gauge whether there are other people that might have the same massive issue of "nothing working right". Maybe there is a common quirk that is known to all, as in maybe everybody knows that the project doesn't work on 3.9 or that the examples in project root are broken and only the examples in the Secondly, "you don't say what you use" is not true. I said I'm on Fedora 33, Python 3.9.1, KDE Konsole over X11 and bash (over actual tty). I am using the latest version of picotui. Thirdly, I even posted specific lines in terminal size query code that fail, returning default terminal size path. That, generally, shouldn't happen (ever?), so there must be something fundamentally wrong. |
So this monkey-patching workaround for the terminal sizing fixes things somewhat: from picotui import screen
class Screen(screen.Screen):
@classmethod
def screen_size(cls):
return os.get_terminal_size(sys.stdout.fileno())
screen.Screen = Screen
from picotui.context import Context
from picotui.menu import (C_WHITE,
C_BLUE,
C_B_WHITE,
C_BLACK,
ACTION_CANCEL,
KEY_F9,
ACTION_OK,
WMenuBox, WMenuBar, Screen)
from picotui.widgets import Dialog, WButton, WLabel, WListBox, WDropDown
... |
Right, please consider a brain-fart. But for modern short attention-span humans, like myself, I'm going to edit the actual description to contain that info. |
As a quick reply, my work environment is Ubuntu MATE with MATE Terminal (1.24 as of now, but different version over last few years). Also tested with Gnome Terminal (of which MATE Terminal is a fork). I'll try KDE Konsole as time permits. In the meantime, please post what you get in it with:
|
I wouldn't err on the side of the of Python version, I'd err on what terminal setup you and/or in which terminal emulator. Just to confirm, I quick ran example_widgets.py with:
and don't see any issues.
Chances are that situation would be opposite - examples in the root is tried all the time, while stuff at
Terminal size querying relies on the particular Xterm escape sequence. MATE Terminal handles that sequence in a way compatible with picotui (speaking conservatively). |
That doesn't tell me much, I would need to see a diff. |
Confirming Xterm mouse not working with Konsole 19.12.3. |
Screen size detection also doesn't seem to work, yeah. |
My guess is that Konsole wants some escape sequence to enable all the "extra" features like mouse input and size reporting... |
Use os.get_terminal_size if it is available Maintain original path if not related to pfalcon#48
Use `os.get_terminal_size` if it is available Maintain original path if not related to pfalcon#48
Please see #49 for terminal size fix/workaround. The call is available in all versions of Python that aren't EOLed. I maintained the alternative for all platforms where it's not available. |
Ok, mouse is working in Konsole in the latest master. |
Suggested further plan re: screen size issue:
|
The same "resize" problem exists when using "st" simple terminal from suckless: https://st.suckless.org |
Firstly, thank you for the project, it reminds me of the good-old Borland Turbo Vision, which was absolutely epic.
However, I just started writing a prototype and the most basic features seem not to work. I guess it's something specific with my setup (Python 3.9?), but I'm still going to report it in case the problem is unknown and global.
Just for the reference, other console tools like
bpytop
ands-tui
work perfectly.I suspect it's all related to console comms but it's hard to say what's going on.
As far as TTY size I always end up going this route with
res
being[]
:picotui/picotui/screen.py
Lines 144 to 146 in 7a26e62
bpytop
usesos.get_terminal_size()
which seems to work perfectly:https://github.com/aristocratos/bpytop/blob/2fbdc35125ad5d9a9f613736f194a33ec69bb14b/bpytop.py#L651
Anybody else has issues with basic functionality like that? I'm running code virtually identical to the https://github.com/pfalcon/picotui/blob/master/example_menu.py
The text was updated successfully, but these errors were encountered: