tmux_super_fingers
tmux_super_fingers copied to clipboard
Decrease flickering & fix @super-fingers-extend
Problem
On my M1 Mac, super-fingers take a bit of time to load and render its UI. Before this PR, this feels pretty janky, since after pressing the hotkey, we immediately switch to a new empty window, then wait around a bit, before rendering.
In the below video, all I type is <PREFIX> f
, then escape, to demonstrate the "jank" of the empty screen:
https://github.com/artemave/tmux_super_fingers/assets/296279/8919171f-473f-4030-a4bb-fe4432272f8d
Solution
Now, we create the super-fingers
window in the background and wait for the UI to finish rendering for the first time before focusing it. The user can still feel some lag in between pressing the hotkey and the window showing up, but there's no longer visual flickering.
Bonus solution
For expediency I'm making a PR from my main branch, which also contains a fix for https://github.com/artemave/tmux_super_fingers/issues/13
The issue was that the FINGERS_EXTEND
environment variable wasn't propagated from the plugin setup script to the run.sh
process.
Getting an error:
Ah, i didn’t test with extension disabled. Lemme patch that.
Alright, should be fixed
I like the idea of addressing the flicker, but, as it stands, the change in this pr makes ux worse off. Namely:
- there's no indication that anything is happening after pressing fingers key
- if anything goes wrong, user doesn't see the error
I do like the clever trick of starting super-fingers window in the background and then switching to it later.
I also think that fixing FINGERS_EXTEND is should be separate from this pr. I can just extract it and push to master if you don't want to create another pr.