Steps to Reproduce:
Since running as administrator works pretty well now, the only thing that's missing is an indication that the window has been run as administrator. Visual Studio (and other apps) use the title bar to indicate this:

I was hoping to work on this issue and I figured out how to implement it, but it seems that translation strings need to be modified, which are seemingly done by a third party.
The suffix would need to be added within this block, and using some method to determine if the application is being run with Admin privileges.
I suppose this would need to be implemented by the VS Code team?
@arkon I think the biggest issue is that I am not sure how to find out that VS Code runs as "Admin". If someone has an idea, I am happy to add it 馃憤
@bpasero I linked to a StackOverflow thread about that previously that should work: http://stackoverflow.com/a/37670360
Ugly. Imho this should go into either a native node module or better, into Electron itself (process.isElevated).
Maybe we should request it upstream for Electron to expose functions to check if we're running as administrator (Windows) or root (UNIX)?
We can, but only with a PR 馃憤
@bpasero Seems like they might favour users using a separate node module for checking for elevated privileges rather than having it implemented as part of Electron (https://github.com/electron/electron/pull/8980#issuecomment-289514100).
Since they suggested is-elevated, I suppose we could use that here?
Last time I checked these modules seem to spawn a process on Windows at least? That is not a solution I would want. A module should use some native code to find out if the user is Admin or not.
Hmm, perhaps you could voice your opinion on that electron thread then?
@arkon sorry I missed your reference to that PR, it looks very cool. Any reason you could not make that a native module? VS Code would use it right away.
@bpasero Is "native module" referring to this?
@arkon exactly! since you already did the hard part of writing the C code, putting this to a native module is not a lot of work imho. See for example this module that we are using which does that: https://github.com/the-ress/node-windows-foreground-love
@bpasero Ah, I see! I'll try my hand at making a native module then.
Awesome 馃憤
I've published native-is-elevated to NPM.
Thanks, I will look into this for April!
Awesome, nice work @arkon!
I played around with the library and noticed that on Windows calling into the module can take 32ms (on my fast macbook pro, running in a VM). Given our performance work we are doing I am feeling not so easy adding this to the critical startup path (the title is on it). I also noticed that the library is not needed on mac or linux where finding out if the user is root or not is very easy.
I think what we can do is the following:
windows-foreground-love)If someone wants to step in, my work is in https://github.com/Microsoft/vscode/commit/3ac3f1e85635e1eb04dd6db12c4fcc6823cbd892
Would it help if native-is-elevated's isElevated() function were to return a promise?
@arkon good point, maybe not a promise but a typical function callback, as with other functions in node that are long running (e.g. fs.stat)
Though could you actually implement that because it seems your call in C land is sync?
@bpasero It ought to be possible. I found this example of using promises, and it seems like Nan could be useful for implementing callbacks. I'll give it a shot.
EDIT: oh wait, I see what you mean by the call being synchronous. I suppose there'd be no way to make it asynchronous unless it somehow did it in a different thread, but the whole point of this was to avoid spawning something extra... 馃
Yeah thats what I think too. That is why my initial reaction was to call this method only after a delay. I can look into it, actually requiring the module is not what takes time, it is calling into that method so we can probably keep that module on all platforms.
I'm noticing some fallout that may be related to this issue.
I am receiving a popup saying it is not safe to run insiders as an administrator, and it states in the title bar that i'm running as an administrator, even though I didn't choose "Run As Administrator" when I started the program. I can confirm that I have opened insiders normally as I did prior to this release , however I can not find a way to deactivate the warning notification.
Yeah maybe it is too aggressive to show this on Windows where it is more likely that you run as admin. I can take it out again.
Verification:
Run Code as Administrator on Windows and verify that the title includes the information that you are running as admin.
@bpasero Any reason we are going with the square brackets [] instead of the normal ones () ?

@ramya-rao-a no, I just picked that style up from the other decorations we had ("Unsupported" and "Extension Development Host").

got it
Most helpful comment
Awesome, nice work @arkon!