sshcode icon indicating copy to clipboard operation
sshcode copied to clipboard

Open sshcode in new Chrome instance on MacOS

Open timbaas opened this issue 6 years ago • 7 comments

Currently when opening sshcode it opens a new window of the already running Chrome instance.It would be great if a new instance of Chrome was started to provide the sshcode app.

It would make it possible to switch between Chrome and sshcode like every other app instead of switching Chrome windows which really takes down the native feeling and goes against the statement that it just feels like native VS Code. (don't get me wrong, anything else really does feel native and I'm really impressed so far!)

There are multiple ways to start separate Chrome instances and I tried the solution provided by Ark565 here: https://superuser.com/questions/1008895/running-two-independent-instances-of-chrome I opened "127.0.0.1:27694" in a normal (non-incognito) window and created a shortcut which left me with an app with both a name ("coder") and icon which launches it's own instance!

A few problems with this:

  • I have to open the shortcut separately
  • The port (27694 in this case) is not persistent
  • It's not running incognito
  • It shows the address bar

timbaas avatar May 21 '19 08:05 timbaas

Digged in the source and edited the chromeOptions function in sshcode.go to include user-data-dir=.data-dir. With this switch present it opens Chrome as a separate instance. I also copied the Chrome app, renamed it to SSHCode.app and added a custom icon. Changed the macPath to use that instead. Copying the Chrome app didn't feel right, but it works for now!

Maybe some more flexibility around the path and options to open chrome with would be nice?

timbaas avatar May 21 '19 12:05 timbaas

sshcode should open within a new app window. I believe that this is intended behavior.

teddy-codes avatar May 21 '19 17:05 teddy-codes

It indeed opens a new window, but it's under the current Chrome instance. (no extra chrome app pops up in the dock)

It's impossible to switch between Chrome and sshcode with Cmd+Tab this way.

timbaas avatar May 21 '19 18:05 timbaas

Hm, I will look into this on my mac, but on my linux machine, this works as intended.

teddy-codes avatar May 21 '19 20:05 teddy-codes

It looks like I am able to reproduce the issue, but ... I am unsure of how to change it in the MacOS world. I am going to continue looking for a solution for this, but as of now, I am drawing a blank. @sreya92 Do you have any idea on how to fix this?

teddy-codes avatar May 24 '19 22:05 teddy-codes

From what I can find online, it looks like the only way to make two separate instances appear on the dock is changing the user data directory. Since we don't rely on anything from the main browser, we could opt for setting the data directory to somewhere temporary on darwin.

deansheather avatar Jun 16 '19 10:06 deansheather

Screen Shot 2019-06-18 at 13 31 55 Here's a picture of my Dock, and it looks like sshcode is opening a new window, as it opens a new icon.

I'm on macOS Mojave 10.14.5 with Chrome version 75.0.3770.90.

sumanthratna avatar Jun 18 '19 17:06 sumanthratna