-
Notifications
You must be signed in to change notification settings - Fork 676
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
Focus is repeatedly stolen from terminal #4608
Comments
The likely culprit is: microsoft/vscode#125800 (comment) Apparently, I'm supposed to play whack-a-mole and ask you to detect when I, the user, have recently clicked the terminal after you've stolen my focus and have you suppress future calls to steal my focus until focus leaves the terminal. So, there you have it. |
@jsoref You can set |
I'm glad there's a workaround. I hope you understand that it isn't a particularly great thing. |
@jsoref Most of the time this is a very useful behavior. When errors are reported it typically means that OmniSharp will be unable to provide language services, so getting that information to the user so they can resolve the reported issue is the right thing to do. This particular error is an unfortunate case because it will be reported for each project in the workspace until project loading is complete. |
In this case, I'd much prefer one of the floating things than a tab steal. And I'm fairly certain I've gotten a bunch of those from this extension. I'm not actually a C# dev. I installed the extension "because VSC told me to". And only much later tried to feed it a .net sdk (probably from a floating thing). I understand how for normal users who are actively making their own changes, being shown output relevant to the work they're doing would be useful. I claim that during initial load, the first or last notification is sufficient as a count (1) of focus steals. (Obviously, I'd prefer exactly 0 focus steals). Not being able to provide language services is a thing, but it should probably be possible to just show a sad face in the status bar instead. If the user cares (I clearly don't), they can click to investigate. |
For most of my C# projects when I open them in visual studio code, I am not building them and running them. For that, I open them in visual studio 2019. When I open projects in visual studio code, I just need a quick IDE and terminal to do some quick tasks, e.g. look at some code or git commands. Now I have to wait and be forced to watch a bunch of errors that is not necessary to do my work. What is the goal for Visual Studio Code when it comes to C#? Is the goal for Visual Studio Code to replicate Visual Studio 2019 for C#? That would be redundant and defeat the purpose of a lightweight IDE. |
@JoeRobich I'm sorry I must disagree. Stealing focus like this is a major UX violation and it is really an inappropriate way to handle errors in this case. There is no error that this plugin can produce that will ever warrant changing the users focus and there is no possible way for you to solve this bug in a way that will gracefully switch the users focus. It is a bug to steal the focus unless a direct user action has directed you to do so. In the case where an error like this issue is encountered, you can use one of the non-focus stealing UI mechanisms to notify the user, such as popping up the toast alert message or perhaps an inline error in the code file or perhaps the color of the alert bar on the bottom or maybe a adding an error notification in a problem panel... There are numerous ways to notify the user when an unrecoverable error has been encountered without altering the users focus. This plugin, like every other plugin, must not alter the users focus unless the user has specifically instructed you to do so with a direct action (click a button, keyboard shortcut, command pallete, whatever). Wikipedia identifies this behavior as an error state A classic opinion piece: Mozilla considers focus stealing a category of bug: |
More... Focus stealing is an accessibility "misfeature" You're my computer - I'm not your human This is such a classic issue, especially for Microsoft specifically, and I just can't believe in 2022 that there is any debate whatsoever that this absolutely a bug. |
Adding that the option In my case, |
This annoyed me so much that I modified the JavaScript file in my extensions folder. I replaced all occurrence of |
Reposted from microsoft/vscode#125800
Issue Type: Bug
output.steals.focus.from.terminal.mov
VS Code version: Code 1.56.2 (054a9295330880ed74ceaedda236253b4f39a335, 2021-05-12T17:44:30.902Z)
OS version: Darwin x64 19.6.0
System Info
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Extensions (55)
A/B Experiments
Environment data
dotnet --info
output:VS Code version:
C# Extension version:
Host (useful for support):
Version: 5.0.6
Commit: 478b2f8c0e
.NET SDKs installed:
5.0.300 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
OmniSharp log
Steps to reproduce
Open a clone of dotnet/winforms
Open a terminal tab
Try to use it
Expected behavior
Focus should not be repeatedly stolen
Actual behavior
Focus is repeatedly stolen.
The text was updated successfully, but these errors were encountered: