I 'cf ssh app_name
' to a nodejs app on diego. Then I want to exit that, type exit
. That also kills the hosting shell (powershell on windows 7). I want my shell to stay. I've tried various commands and looked in the diego docs but I'm somehow missing this.
Asked
Active
Viewed 3,314 times
1

amadain
- 2,724
- 4
- 37
- 58
-
1Have you tried another shell? Maybe just the windows command prompt? Do you see the same behavior? For what it's worth, you can also connect with any standard SSH client. Instructions here -> https://github.com/cloudfoundry/diego-ssh#cloud-foundry-via-cloud-controller-and-uaa – Daniel Mikusa Jan 24 '17 at 20:16
-
1Are you opening the powershell window first and running the `cf` command within on its prompt, or passing the `cf` command directly to the powershell executable? In case of the latter, add "-no-exit". In case of the former, I'm on Windows 7 and when I `exit` from a `cf ssh` session to my app, it does not kill my powershell, so I wonder if this is a Powershell configuration issue. (This is with the latest cf CLI and a "vanilla" Powershell (I hardly use it so if there is anything configurable on it, I haven't done so)). – dkoper Jan 25 '17 at 01:29
-
Thanks for the tips daniel-mikusa and @dkoper. I suspected I was missing something obvious and it was the shell; I've got a couple of workarounds now I'll write up. – amadain Jan 25 '17 at 09:12
1 Answers
1
It was the shell. It doesn't happen from a regular Windows's cmd prompt. In powershell use: powershell -noExit "cf ssh app_name"
It is possible to set a powershell function to shorten it: function psne { powershell -NoExit $args[0]}
Then run psne "cf ssh app_name"
. Functions can be saved to the profile to run automatically.
But on balance, my solution for now will be to use the windows command prompt. The powershell, while generally the best thing since sliced bread, doesn't give me any advantages here.

amadain
- 2,724
- 4
- 37
- 58