GNOME Bugzilla – Bug 789137
Hide cursor on focus out
Last modified: 2018-04-24 21:48:20 UTC
Inspired by https://bugs.launchpad.net/terminator/+bug/1724440 We could add an option to hide the cursor on focus out. Rationale: That's what pretty much every (non-terminal) graphical app does. The visible cursor is one per desktop, not one per app or one per some widget. For non-focused widgets the cursor position doesn't really matter, it's okay to reveal it only when it gets focused. Also, it slightly helps locate the focused terminal window in case of i-beam or underline cursor.
Changing the I-beam width can already be achieved with current VTE, e.g.: ~/.config/gtk-3.0/gtk.css vte-terminal:focus { -GtkWidget-cursor-aspect-ratio: 0.15; /* 2px at my favorite font */ } vte-terminal { -GtkWidget-cursor-aspect-ratio: 0; /* 1px enforced by vte */ } Note however that the initial cursor width in newly opened windows is incorrectly the narrow one in about half of the cases in Unity 7; a focus toggle is required to repair it. It works reliably in GNOME Shell. Re-adding the line that was added in bug 727614 and moved elsewhere in bug 787710 does not fix it. Sounds to me either a GTK+ or a Unity 7 bug, perhaps related to bug 788334.
Created attachment 361803 [details] [review] Proof of Concept Just a quick proof of concept patch to see if we like this behavior at all. I'll use this for a while and get back with my experiences. Obviously it would need to be behind an API or some other kind of config option if we decide to go for it, probably the old behavior remaining the default.
Middle-click paste is one scenario where it's important to see the cursor position in unfocused windows. It's different in graphical apps (textarea widgets etc.) because there middle-clicking not only gives focus to the app, but also sets the cursor position (where the text is inserted). This latter step cannot be done in terminal emulators. I personally don't middle-click because my laptop's touchpad has two buttons and I didn't bother setting up some kind of emulation, I'm okay with Shift+Insert or Ctrl+(Shift+)C/V copy-paste. I guess it's the same for many other folks, but by far not for everyone.
Experiences after a week: The difference is hardly noticeable for me. I never got distracted by the cursor being hidden in unfocused terminals, it never caused any sort of (mental or other) problem. In a few cases it probably slightly helped me not to accidentally type into the wrong window. If we had such an option, I'd probably enable it. I'll keep using the patch for a while.
Comment on attachment 361803 [details] [review] Proof of Concept Let's try this, master only. We can always later add API to select between this and outline cursor.
Well, not sure if we should force this on everyone... even if we do, the outline cursor should be #if 0'd.
The lack of the cursor is also annoying if there's an unfocused window where you're watching new output being produced. Probably I'd be the only one using this feature, and even I'm not super convinced. Unless you object, I'd close as wontfix.
No objections.
Another case where this is terribly confusing: When it takes a lot of time for a utility to start producing output, you cannot tell for sure whether you've launched that command, or just prepared the command line but haven't pressed Enter.