zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
47.74k stars 2.79k forks source link

Focus follows mouse #8167

Open simoncocking opened 7 months ago

simoncocking commented 7 months ago

Check for existing issues

Describe the feature

Add a configuration option to send focus to the editor pane (or terminal) under the mouse cursor. AKA focus follows mouse.

To elaborate, #4336 describes part of the problem: when you return focus to Zed after activity in another app, the click serves only to focus Zed and does not activate the pane that was actually clicked; rather, the last active pane gets focus. I cannot describe how frustratingly often this bites me - especially when using an integrated terminal in Zed. Having come from desktop Linux many years ago and finding focus-follows-mouse in iTerm2, Zed focuses exactly the wrong thing every single time.

Having:

  1. the initial app-focusing click also focus the pane clicked; and
  2. focus follow the mouse to whichever editor pane it's over

would be a massive quality of life improvement.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

JosephTLyons commented 7 months ago

Hey @simoncocking, can you check this issue out and see if it covers what you are asking? They feel the same, but not entirely sure - I'll let you make the call:

simoncocking commented 7 months ago

Hi @JosephTLyons, I referenced that issue in my description above and commented on it directly a few days ago.

Basically I'd consider what #4336 describes as a bug: I expect focus to be directed wherever I click, not wherever it was the last time the app had focus. What I'm describing here would be more of a feature request: send focus to whichever editor pane is under the mouse cursor.

Focus-follows-mouse has long been a quality-of-life improvement in X Windows desktops. iTerm2/3 supports it on the Mac and it's wonderful; it would be equally wonderful in Zed.

JosephTLyons commented 7 months ago

Hi @JosephTLyons, I referenced that issue in my description above and commented on it directly a few days ago.

Basically I'd consider what #4336 describes as a bug: I expect focus to be directed wherever I click, not wherever it was the last time the app had focus. What I'm describing here would be more of a feature request: send focus to whichever editor pane is under the mouse cursor.

Focus-follows-mouse has long been a quality-of-life improvement in X Windows desktops. iTerm2/3 supports it on the Mac and it's wonderful; it would be equally wonderful in Zed.

Ah, you're right. I'm sorry, the speed at which we are getting issues is making it harder and harder catch all the details in these. My apologies! Thanks for bearing with me and repeating what you've already said. 🤦

MrHaroldA commented 2 months ago

I would love focus follows mouse as well! It makes working with multiple panes (editor, terminal, etc) way faster and more comfortable ...