home.social

#urwid — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #urwid, aggregated by home.social.

fetched live
  1. @rl_dane

    It basically redraws entire lines at a time, and a single character change invalidates the entire line that it is on.

    #urwid #TUIs #SerialCommunications #Unix #ncurses

  2. @rl_dane

    It basically redraws entire lines at a time, and a single character change invalidates the entire line that it is on.

    #urwid #TUIs #SerialCommunications #Unix #ncurses

  3. @rl_dane

    Youth of today, with your emulators! (-:

    I simply have an actual serial port that I can set to 1200 BPS, and log in on.

    From a quick perusal of its 'raw' driver's code, you probably do not want to know #urwid's drawing behaviour.

    #TUIs #SerialCommunications #Unix #ncurses

  4. @rl_dane

    Youth of today, with your emulators! (-:

    I simply have an actual serial port that I can set to 1200 BPS, and log in on.

    From a quick perusal of its 'raw' driver's code, you probably do not want to know #urwid's drawing behaviour.

    #TUIs #SerialCommunications #Unix #ncurses

  5. @rl_dane

    It's not quite right, but you might like to experiment with instead of running that second reset running

    stty cbreak; tput ti; kill -WINCH 0

    These are just a bodge. The #urwid library and #sncli should be fixed.

    #ncurses #termcap

  6. @rl_dane

    It's not quite right, but you might like to experiment with instead of running that second reset running

    stty cbreak; tput ti; kill -WINCH 0

    These are just a bodge. The #urwid library and #sncli should be fixed.

    #ncurses #termcap

  7. @rl_dane

    It would have to be more complex than that: a tool that sets cursor addressing mode and non-canonical input mode back up after nvi exits (which is when nvi tears down cursor addressing mode and all that stuff).

    reset actually does the opposite of that.

    Sadly, #ncurses, which #urwid can be layered on top of, is quite capable of switching between 'prog' and 'shell' modes; but this is simply not used by urwid and is not even the urwid underpinning that is chosen by #sncli anyway.

  8. @rl_dane

    It would have to be more complex than that: a tool that sets cursor addressing mode and non-canonical input mode back up after nvi exits (which is when nvi tears down cursor addressing mode and all that stuff).

    reset actually does the opposite of that.

    Sadly, #ncurses, which #urwid can be layered on top of, is quite capable of switching between 'prog' and 'shell' modes; but this is simply not used by urwid and is not even the urwid underpinning that is chosen by #sncli anyway.

  9. @rl_dane

    #sncli relies on a Python library named #urwid that simply has no concept of temporarily restoring the canonical terminal mode whilst shelling out to external programs.

    urwid.org

  10. @rl_dane

    #sncli relies on a Python library named #urwid that simply has no concept of temporarily restoring the canonical terminal mode whilst shelling out to external programs.

    urwid.org

  11. What are everybody's favourite simple #TUI libraries.

    I've been looking at #npyscreen and #urwid or maybe #textual or #picotui ?

    Basically, I want to design a #cyberdeck sort of thing, but I want the interface to be more like a Gameboy or an old fashioned purpose-built device.

  12. What are everybody's favourite simple #TUI libraries.

    I've been looking at #npyscreen and #urwid or maybe #textual or #picotui ?

    Basically, I want to design a #cyberdeck sort of thing, but I want the interface to be more like a Gameboy or an old fashioned purpose-built device.

  13. #urwid is really nice for fast hacking neat terminal interfaces. gave it a go, much fun :) you won't feel cursed. #python
    urwid.org

  14. #urwid does support overriding each LineBox character. So I should be able to plug in the existing config I wrote at least.
    Unfortunately it also suffers from width miscalculations when the label contains more complex emoji, especially for ones that aren't rendered properly by the terminal... I guess that'll end up being an issue that will depend on upstream fixes.
    All I could perhaps do is offer a way to specify padding/width offsets for certain glyphs or buttons, but that might only work for my own box implementation rather than LineBox.

  15. That feeling when you find out that the function you've been #coding to add some functionality to a library, is actually already sort of implemented (and better?) in the library itself...

    I guess I can simplify the box-drawing code for #TUILauncher as #urwid has urwid.LineBox().
    (Though I might miss out on the custom box-drawing glyphs (unless that's also implemented already))

  16. @kelbot maybe something to do with the way I calculate width, and/or the way #urwid handles multibyte characters.

    Can you paste the characters you are using so I can test it myself tomorrow?

  17. @kelbot I think I actually have something working with #urwid too, though some terminals might have issues with mouse coords beyond a certain amount of columns.
    What exactly do you want it to do after clicking on a button? Do you want it to end the button application and launch it in the same pane/window?
    Open a new tmux/screen window and launch it in that? Switch to a specific tmux pane, and launch it in that? (And what happens then if that pane is already running an app? Should it SIGSUSPEND?)

  18. @kelbot alternatively you can probably write a simple #TUI in #Python with #Urwid, which seems to support mouse input: urwid.org/manual/userinput.htm