jupyter-xeus / cpp-terminal

C++ library for writing multiplatform terminal applications
https://jupyter-xeus.github.io/cpp-terminal/
Other
490 stars 53 forks source link

add Focus detection #296

Closed flagarde closed 11 months ago

certik commented 11 months ago

Beautiful. This is needed. It's my favorite feature of neovim, that it autosaves when the terminal loses focus, and autoreloads when it gains focus.

flagarde commented 11 months ago

I agree I like this feature too. I already implemented in an old PR but as I changed a lot the way events are processed i implemented alone (out of mouse position support). I tried to add mouse report too but the terminal crashes after some times in this case... I'm not sure rhe enum values to activate this on windows are compatible with the new escape code feature... When resizing the windows the terminal stop and crashes. I try to find information on windows help but their help page doesn't help at all 😬. Maybe even just reporting the focus can crash the terminal. Need more testing. If someone have some information about how to deal with this it would help a lot.

The mous position report is the only missing part to have all the events that really matters.

flagarde commented 11 months ago

I'm glad you like it. To be honest I implement what I think it would bebnice to have but i'm not sure I'm moving in the good direction or in the way you want your library to go.