alacritty / vte

Parser for virtual terminal emulators
https://docs.rs/vte/
Apache License 2.0
242 stars 56 forks source link

Read user input #108

Closed gwenn closed 11 months ago

gwenn commented 11 months ago

Would it be possible to use vte to read user input (keyboard / mouse) in raw mode ? I am doing experiments here. And it appears that some key sequences are not reported like:

Thanks.

kchibisov commented 11 months ago

It's for generally parsing escapes you get from the application and implement virtual terminal emulator, not for the application side itself, since it's different. It could be improved to handle both sides of the equation, but there're already creates doing so, like crossterm.

gwenn commented 11 months ago

But crossterm is huge. And termwiz is partially using vtparse for interpreting user input (vtparse ~= vte) but has the same issue.

I would like to replace this mess (which has been around longer than crossterm) without depending on async io.

kchibisov commented 11 months ago

This is pretty much out-of-scope for this library, however nothing stops from building derivative for client part of terminal apps.

I don't want to have a decoding of kitty/terminfo/all other stuff here.

Like input is more complicated than you might think of it.

chrisduerr commented 11 months ago

It's for generally parsing escapes you get from the application and implement virtual terminal emulator, not for the application side itself, since it's different. It could be improved to handle both sides of the equation, but there're already creates doing so, like crossterm.

This is not entirely true. Most existing libraries like crossterm are pretty bad and VTE is perfectly capable of handling the client side of things too: https://github.com/chrisduerr/sketch/blob/master/Cargo.toml#L8

gwenn commented 11 months ago

@chrisduerr So should I reopen this issue ?

kchibisov commented 11 months ago

No, it's already possible. If you want something like ansi but for client, that part is out of scope.