How to exit app and exec transferring to main user shell/terminal?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 14.4k
- Forks
- 756
- PR merge metrics
- No merged PRs in 30d
Description
Node version (or tell us if you're using electron or some other framework):
13.8.0
ShellJS version (the most recent version/Github branch you see the bug on):
0.84.0
Operating system:
macOS Catalina
Description of the bug:
I'm starting a SSH session from my node.js CLI app using shelljs. It works fine, but after closing the session the app hangs. I need to press CTRL + C in order to terminate my node.js app.
What I'd like to achieve?
- I'd like to exit my app and just run the SSH command externally as if the user had entered the command directly in the shell terminal.
- If the first is not achievable, then it'd be fine if once the SSH session finishes (user type
exitfor instance) my app could then terminate gracefully.
Am I doing something wrong with code below?
Example ShellJS command to reproduce the error:
shell.exec('ssh -tt 1.2.3.4', { async: false, stdio: 'inherit' });
console.log('How could I see this message after close SSH session?');
shell.exit(1); // Is this supposed to exit the node.js code and transfer control to user terminal?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided shell.exec('ssh -tt 1.2.3.4', { async: false, stdio: 'inherit' }) example on Node 13.8.0, ShellJS 0.84.0, and macOS Catalina. Trace what happens after the SSH session exits and determine whether the requested terminal handoff or graceful app termination is supported; done means the behavior is documented or covered by a verified fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js, shell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100