shelljs / shelljs/shelljs

How to exit app and exec transferring to main user shell/terminal?

Offen
#999 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
JavaScript
Sterne
14.4k
Forks
757
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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?

  1. 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.
  2. If the first is not achievable, then it'd be fine if once the SSH session finishes (user type exit for 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?

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, node.js, shell
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.