-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Helix in unfocused window should appear differently than in a focused window #1187
Comments
#1154 may be relevant. |
Do you mean split windows inside the editor itself or different terminal windows running separate |
I meant really, both, in the sense that the active cursor could look different than an inactive one - or that the whole buffer or pane that is in focus, and, therefore, ready to be interacted with by a user, would look different than other buffers, panes, windows, and so on. I see your point about the window manager. I don't have a completely specific vision for this yet. I think having something in the helix UI that says 'ready!' would be nice, again, due to the fact that many users including myself can have a number of windows, buffers, splits, panes etc all open at once. |
For determining the active split I've been relying on the statusline (there's an inactive style). I've been missing some sort of indicator when the editor isn't in focus though, but this isn't possible since we get no such events from the terminal. It's more visual in vim because the terminal cursor will move out of the editor, but ours are "hand-drawn" due to multiple selections and are always present, Kakoune has the same behavior. |
#1154 uses the terminal cursor, so the cursor becomes hollowed (works on alacritty, kitty, wezterm, etc) which is what I rely on with vim: |
This looks good! I think it would be great to use, even as an option. If this is the best way to go, but needs something for configurability or implementation, I'd be interested in trying to make it work. I'll also keep my eye on #1154. |
FWIW, I think for Also, unfortunately due to |
Okay I was wrong, some terminals do support this feature:
Using these two events we should be able to detect focus and change cursor styling |
Hi!
theme = "onelight"
[editor]
line-number = "relative"
mouse = false
[editor.file-picker]
hidden = false
[editor.cursor-shape]
normal = "block"
insert = "bar"
select = "underline |
The primary cursor in helix is the terminal emulator's cursor which is switching between panes when you switch tmux windows. It might be possible to handle this case by drawing a block where the cursor was but we would need to handle focus events (we don't currently) and it would be inconsistent with the behavior when you switch between splits within helix (although that could be improved too). |
If you use Zellij (similar to Tmux) and don't hide the pane frames, then the frame will help you until Helix implements a solution :) |
I tested the |
Neovim doesn't render multiple fake cursors, it just positions the terminal cursor. I have a branch that has this working locally, but it's the same problem, the cursor disappears. |
Should we render the main primary cursor using the real terminal cursor then we can keep the rest as fake cursors? |
Here what I watched: The file picker cursor disappears if I focus a different Zellij pane and becomes hollow if I focus a different application. Using sway and foot. It looks like Zellij takes away the main cursor from helix. I think helix should handle focus events: from the window manager and from terminal multiplexer, no idea whether this is doable, in my opinion no need to discern these two cases, but the status bar should switch to inactive when:
I also think, helix should use a fake cursor in the pickers and give the possibility to style the cursor for inactive splits and pickers differently. Edit I tried that while in insert mode (where I have a bar cursor). It disappears when I switch to a different Zellij pane and reappears when returning. It stays when I switch to a different application. Since helix leaves the insert mode when switching to a different split, we can ignore that for helix. |
At a glance it is impossible to determine if a helix instance is in focus (actively being used) or not. Often users will have more than one instance of a text editor open right next to each other on their screen. They should be able to see from some visual cue which instance is in focus.
I imagine an inactive helix window being slightly desaturated (colors all shifted to be more grey), or, minimally, having a clear indication of which cursor(s) are in an active in-focus window.
The text was updated successfully, but these errors were encountered: