-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Allow to open different windows with different permissions #6560
Comments
I would say this is impossible today given our process architecture. |
Why is this impossible? Is there a way to make it possible? |
Would it be possible to include the elevation status in the pipe name so there are two parallel pipes for elevated and non-elevated processes? |
Hi. If you try to open a file in VS Code from command line using -r option to reuse existing window still fails if you have opened it using admin rights. |
Opening VS Code as elevated administrator in Windows. Then open an elevated PowerShell prompt and movide to a folder, then issue |
I didn't remember if my last code window was opened as admin and I was unable to open a new window running |
The workaround for this is to force code to always run as administrator by right clicking on the exe, going to Properties, clicking on the Compatibility tab and check the box labeled "Run this program as an administrator". |
Maybe we should look at other electron-based apps, how they are handling multiple instances on windows and fix this issue. This is hurting the user experience. I had a demo effect with this one, which silenced the audience who were otherwise applauding the use of VSCode and it's |
This just happenned to me as well. "A second instance of Code is already running as administrator". Baffling that this happens. Posting it just to update the date on the thread that the issue is still around. Running on Windows 7 x64 (Powershell 3.0) using Code version 1.21.1 |
+1 also happening to me. I'm confused by this thread. Is this behavior by-design or incorrect? I figure a text editor should be able to have as many instances as I want. |
It is annoying but its funny how we all complain about it but none's submitted a pull request. ;-) |
Not every user running into this has the skills to do so. I certainly don't, I am a java dev. Others may be python devs etc. Anyway, most of us would be happy with a workaround provided by Microsoft. |
6 years old and STILL no fix. This is really silly. |
Aha, This bug let us meet at this corner~ |
The eternal flame!
…On Wed, Aug 24, 2022 at 10:54 PM Yukang ***@***.***> wrote:
Aha, This bug let us meet at this corner~
—
Reply to this email directly, view it on GitHub
<#6560 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANAZWXVOSJRVFN4B7F2GG3V2X5ONANCNFSM4CEK7MIQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
Justin Romaine
Senior Architect
Titanium Solutions Ltd.
***@***.***
+64 21 764 506
hm 09 445 9166
|
I just ran into this because when I start a new code document, I typically type: code somesourcefile.c .py or whatever. Then in separate directory I click on a source file to look at a different piece of code and BAM! I get this pop-error. So apparently I cannot work in one directory where I need admin privs and a completely different directory where I don't. This is a really annoying feature! |
I know. I can't see why they don't just request elevation by shutting down all code instances and relaunch elevated. You will get a uac prompt and off you go. Easy |
We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider. If you wonder what we are up to, please see our roadmap and issue reporting guidelines. Thanks for your understanding, and happy coding! |
Ah. It is not intended to run VS Code on Terminal Servers? That should at least be worth a note in the README file. 🤔 |
You don't plan to address this issue? It is a critical feature for those of us who are required to run in both non-elevated and elevated environments due to security requirements? Do you have, perhaps, a best practices guideline that we could at least try to follow so that we can work? |
Not addressing this issue is ridiculous. Simply having an elevated instance open should not preclude me from opening anything else. At the very least, present some options to allow the user to proceed, opening the requested file in the same elevated instance or open a new non-elevated instance automatically. At the moment the workflow is halted because VS Code simply says "no". |
I'm threatening a pull request. In my world, there is no such think as "can't". VS Code is a pretty good product as everyone here would openly testify to but this is annoying and I would like more of an explanation as to WHY? this is not an easy fix. Is it a node binding limitation? an election no-no? maybe some limitation in the portability of the framework. I have not looked into it but i would be happy to discuss this issue with a developer that does. Maybe I could help. |
Installing the system version as opposed to user version seemed to do the trick for me. Couldn't even fully uninstall user version due to user/appdata/local/programs permission issues. EDIT: Nevermind, a few opens later the issue came back up. Notepad++ it is. |
As a developer, I want to know why is this impossible? It's not that it cannot open in Admin or non-Admin at all. I can open:
I just noticed one thing that if VSCode is opened from PS, then some debug logs keep showing that is probably coming from VSCode. Is that pipe-to-console connection preventing it? If so, why to connect it ? |
So what's the chance of this opening again? This issue is truly a deal breaker. |
You can enable the compatibility tab on Windows by "Edit Group Policy". Then from the compatibility tab you can check the box "Run this program as an administrator". You'll need to restart your PC. It works on Windows 10 and 11. |
Can confirm that this workaround from @kakugiki works. Full steps below:
|
Executing always as administrator IS NOT a workaround. |
Umm. It's now mid-2023. Please fix this already. I really need to have multiple CODE instances running as admin on Windows. Please make EVERY instance of Code use its own settings or whatever file. It's not that hard if you already support multiple instances of non-elevated execution. |
Defining Code.exe to always run as administrator fixed this issue for me, but it should actually be the standard behaviour. |
This is just silly. It's time to fix this behavior. |
Thank you very much! It works for me too |
I believe @johlju 's comment could be considered a type of workaround if you want to have multiple elevated VS Code instances with different directories.
So,
Just something that worked for my situation. |
That seemed to work for me also, however I later discovered this causes problems with other local development software (e.g., LocalWP/Local Flywheel). So, while this approach appears to fix one issue, it likely will cause other things to break. |
Exactly |
Thank you @kadirgun! this fixed my case I had for so long |
Steps to Reproduce:
Note: there are multiple other ways to trigger this issue, the above repro is just an example.
Note 2: If you already have a code instance running without administrator running, the above issue will not get triggered. That's why the very first step is to close all Code instances.
The text was updated successfully, but these errors were encountered: