(#4b4ypwa) @movq@www.uninformativ.de I guess so, yes. I read something about that in some ticket. In v3 the terminfo support was dropped, though. Iâm still on v2 at the moment.
#g6t22uq
(#4b4ypwa) @movq@www.uninformativ.de I guess so, yes. I read something about that in some ticket. In v3 the terminfo support was dropped, though. Iâm still on v2 at the moment.
(#4b4ypwa) @lyse@lyse.isobeef.org ⊠I sure hope that they generate these files from the general terminfo database instead of maintaining their own DB. đł
(#4b4ypwa) And tcell seems to support my urxvt in general: https://github.com/gdamore/tcell/blob/v2/terminfo/r/rxvt/term.go#L144
(#mqvmwva) @movq@www.uninformativ.de Woah, thatâs really amazing progress! :-)
(#mqvmwva) @bender@twtxt.net Iâm already using it for tracktivity (meant for tracking activities and events, like weather, food consumption, stuff like that), which is basically a somewhat-fancy CSV editor:
https://movq.de/v/f26eb836ee/s.png
I have a couple of other projects where I could use it, because they are plain curses at the moment. Like, one of them has an âedit boxâ, but you canât enter Unicode, because it was too complicated. That would benefit from the framework.
Either way, itâs the most satisfying project in a long time and Iâm learning a ton of stuff.
(#4b4ypwa) @movq@www.uninformativ.de Yeah, I know that terminals are super weird and messy. In both the KDE Konsole (identifying itself as TERM=xterm-256color) and xterm (TERM=xterm) it just works flawlessly. My urxvt (TERM=rxvt-unicode-256color) just doesnât. I also tried messing with TERM in urxvt, but no luck so far.
(#4b4ypwa) @lyse@lyse.isobeef.org Unix terminals are quite limited in that regard. đ«€ You know how Ctrl works? The XOR 0x40 thing? And Alt doesnât exist at all, itâs just a prefixed ESC byte.
I was surprised to see curses knowing about âShift+Tabâ, wondering how that is supposed to work. Well, itâs an escape sequence, of course (depending on the terminal, of course).
(#4b4ypwa) Well, in Xterm, I actually do get key combinations with the Shift modifier. Also, combinations of several modifiers just work exactly as I expect. But not in URXvt. Hmm.
Here am I looking at the different tcell.Key constants and typing different key combinations in the terminal to see the generated tcell.EventKeys in the debug log. Until I pressed Ctrl+Alt+Backspace⊠:-D Yep, suddenly there went my XâŠ
So far, it appears as if I can have either only Ctrl or Alt as modifiers. But not in combination. And Shift is just never ever set at all. Interesting.
Some work on the menu system to brighten my mood a little bit. No mouse support yet.
(#ajerg7a) @prologic@twtxt.net Probably not, but thanks. đ Itâll get better.
(#ajerg7a) @movq@www.uninformativ.de Anything we can do? Lend a listening ear? đ
(#ajerg7a) @prologic@twtxt.net Work and the general state of (gestures broadly) everything.
(#ajerg7a) @movq@www.uninformativ.de Whatâs up? hmm đ§
Frustration level: Through the roof.
(#sczoyta) Ha, I just stumbled across https://codeberg.org/tslocum/cbind, perfect!
(#r7dvytq) @bender@twtxt.net ICQ, yeah, I vaguely remember these times, despite I still know my ICQ number like it was yesterday. :-D
@shinyoukai@neko.laidback.moe No, itâs not dead. The one account in question actually is on jabber.org.
(#zqzv6cq) @bender@twtxt.net I vaguely remember this, some leftover from the old-style hashtags? The (#foo) stuff? đ€
Heh I thought I fixed that bug? (is it s abug?!)
(#2puspya) @lyse@lyse.isobeef.org Never heard of either, tbh. đł
This week, Mu (”) get s bit more serious and starts to refactor the native backend (a lot). Soonâą we will support darwin/arm64, linux/arm64 and linux/amd64 (Yes, other forms of BSD will come!) â Mu (”) also last week grew concurrency support too! đ€Ł
@klaxzy@klaxzy.net nothing like a blank twt eh? đ
Iâm trying to implement configurable key bindings in tt. Boy, is parsing the key names into tcell.EventKeys a horrible thing. This type consists of three information:
Itâs hardcoded usage results in code like this:
func (t *TreeView[T]) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive)) {
return t.WrapInputHandler(func(event *tcell.EventKey, setFocus func(p tview.Primitive)) {
switch event.Key() {
case tcell.KeyUp:
t.moveUp()
case tcell.KeyDown:
t.moveDown()
case tcell.KeyHome:
t.moveTop()
case tcell.KeyEnd:
t.moveBottom()
case tcell.KeyCtrlE:
t.moveScrollOffsetDown()
case tcell.KeyCtrlY:
t.moveScrollOffsetUp()
case tcell.KeyTab, tcell.KeyBacktab:
if t.finished != nil {
t.finished(event.Key())
}
case tcell.KeyRune:
if event.Modifiers() == tcell.ModNone {
switch event.Rune() {
case 'k':
t.moveUp()
case 'j':
t.moveDown()
case 'g':
t.moveTop()
case 'G':
t.moveBottom()
}
}
}
})
}
This data structure is just awful to handle and especially initialize in my opinion. Some compound tcell.Keys are mapped to human-readable names in tcell.KeyNames. However, these names always use - to join modifiers, e.g. resulting in Ctrl-A, whereas tcell.EventKey.Name() produces +-delimited strings, e.g. Ctrl+A. Gnaarf, why this asymmetry!? O_o
I just checked k9s and theyâre extending tcell.KeyNames with their own tcell.Key definitions like crazy: https://github.com/derailed/k9s/blob/master/internal/ui/key.go Then, they convert an original tcell.EventKey to tcell.Key: https://github.com/derailed/k9s/blob/b53f3091ca2d9ab963913b0d5e59376aea3f3e51/internal/ui/app.go#L287 This must be used when actually handling keyboard input: https://github.com/derailed/k9s/blob/e55083ba271eed6fc4014674890f70c5ed6c70e0/internal/ui/tree.go#L101
This seems to be much nicer to use. However, I fear this will break eventually. And itâs more fragile in general, because itâs rather easy to forget the conversion or one can get confused whether a certain key at hand is now an original tcell.Key coming from the library or an âextendedâ one.
I will see if I can find some other programs that provide configurable tcell key bindings.
(#2puspya) @movq@www.uninformativ.de Sorry, I meant the builtin module:
$ python3 -m pep8 file.py
/usr/lib/python3/dist-packages/pep8.py:2123: UserWarning:
pep8 has been renamed to pycodestyle (GitHub issue #466)
Use of the pep8 tool will be removed in a future release.
Please install and use ```pycodestyle` instead.
$ pip install pycodestyle
$ pycodestyle ...
I canât seem to remember the name pycodestyle for the life of me. Maybe thatâs why I almost never use it.
(#5bf3c5q) @lyse@lyse.isobeef.org
Pep8 is deprecated, I think
Hmm, I donât think it is, this still says âStatus: Activeâ: https://peps.python.org/pep-0008/ đ€
Oh no, spam via Jabber is new for me. Fuck them!
(#pebgp3a) @movq@www.uninformativ.de @prologic@twtxt.net Thatâs what I like about Go, too. However, every now and then I really dislike the result, e.g. when removing spaces from a column layout. Doesnât happen often, but when it does, I hate it.
I think I should have a look at Python formatters, too. Pep8 is deprecated, I think, itâs been some time that I looked at it.
(#f5fb6gq) @kiwu@twtxt.net Oh? đ€ Whatâs up? Can you share? Or just having a hrd time? đ€
(#pebgp3a) @movq@www.uninformativ.de Welcome to the dark side đ€Ł
Since I used so much Rust during the holidays, I got totally used to rustfmt. I now use similar tools for Python (black and isort).
What have I been doing all these years?! I never want to format code manually again. đ€Łđ
(#74u6qdq) @shinyoukai@yume.laidback.moe Hopefully, yes. Havenât tried it yet.
(#74u6qdq) @movq@www.uninformativ.de so basically an analogue to Xorg?
(#u53qyya) @movq@www.uninformativ.de in the only feed he has remaining, since the twtxt.net incident⊠doesnât look like thereâs any activity
(#u53qyya) @movq@www.uninformativ.de I donât think he is đ€
(#u53qyya) @shinyoukai@neko.laidback.moe mckinley is back? Where? đ€
Okay, I had heard of âRiverâ before but I was not aware of this:
https://codeberg.org/river/river
River defers all window management policy to a separate window manager implementing the river-window-management-v1 protocol. This includes window position/size, pointer/keyboard bindings, focus management, window decorations, desktop shell graphics, and more.
This sounds promising and it follows the old X11 model. River does all the nasty Wayland work and I can make just the WM? đ€đ€Ż
@mckinley@mckinley.cc ohai, long time!
For me, the âBe kind.â sentence is more of a threat than anything else.
The redirects are there, now whether how long anyone will take to catch up is anyoneâs guess
俥ăăăăç§éăć€çŹăăăȘăă
Iâve moved
(#ee3stma) @shinyoukai@neko.laidback.moe Whoohoo! Thatâs a start to cross-platform support đ€Ł
(#q33dfjq) Patch applied!
(#wulnloq) @movq@www.uninformativ.de Aha! Well, happy hacking. A tiling window manager seems to be good fun. :-)
It drizzled all morning when we picked up the old christmas trees in town with the scouts. Right after lunch the snow storm suddenly hit and dumped three centimeters of snow in just 15 minutes. I cycled home in these crazy conditions, freezing rain hammered my face. As soon as I arrived, it stopped. Itâs now down to drizzling again.
All my soaked gear is now hung up to dry. The next 11 months, Iâm going to find needles over needles in all kind of impossible places.
(#q33dfjq) @shinyoukai@neko.laidback.moe No email has arrived here? đ€
(#q33dfjq) @shinyoukai@neko.laidback.moe Okay I pushed a commit that hopefully fixes this. I hope!
(#q33dfjq) @shinyoukai@neko.laidback.moe Yes; however the interpreter is also platform dependent and relies on making raw syscalls. This is so the runtime semantics remain the same between the two execution modes.
Iâll see if I can add support for linux/amd64 and netbsd/amd64 for the VM at least.
(#g34eztq) @lyse@lyse.isobeef.org Itâs not super comfortable, thatâs right.
But these mouse events come with a caveat anyway:
ncurses uses the XM terminfo entry to enable mouse events, but it looks like this entry does not enable motion events for most terminal emulators. Reporting motion events is supported by, say, XTerm, xiate, st, or urxvt, it just isnât activated by XM. This makes all this dragging stuff useless.
For the moment, I edited the terminfo entry for my terminal to include motion events. That canât be a proper solution. Iâm not sure yet if Iâm supposed to send the appropriate sequence manually âŠ
And the terminfo entries for tmux or screen donât include XM at all. tmux itself supports the mouse, but Iâm not sure yet how to make it pass on the events to the programs running inside of it (maybe thatâs just not supported).
To make things worse, on the Linux VT (outside of X11 or Wayland), the whole thing works differently: You have to use good old gpm to get mouse events (gpm has been around forever, I already used this on SuSE Linux). ncurses does support this, but this is a build flag and Arch Linux doesnât set this flag. So, at the moment, Iâm running a custom build of ncurses as a quick hack. đ And this doesnât report motion events either! Just clicks. (I donât know if gpm itself can report motion events, I never used the library directly.)
tl;dr: The whole thing will probably be âkeyboard firstâ and then the mouse stuff is a gimmick on top. As much as Iâd like to, this isnât going to be like TUI applications on DOS. Iâll use âWindowsâ for popups or a multi-window view (with the âWindowManagerâ being a tiny little tiling WM).
(#q33dfjq) @shinyoukai@neko.laidback.moe if you donât show me the actual full stacktrace, I canât fix the problem đą