Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to terminate shell process which was not awaited. #42

Open
riseryan89 opened this issue Apr 17, 2021 · 2 comments
Open

How to terminate shell process which was not awaited. #42

riseryan89 opened this issue Apr 17, 2021 · 2 comments

Comments

@riseryan89
Copy link

riseryan89 commented Apr 17, 2021

I have tried ssh command and ssh process is still running after quit.

Any solutions?

[✓] Flutter (Channel dev, 2.2.0-10.1.pre, on Mac OS X 10.15.7 19H114 darwin-x64)
[✗] Android toolchain - develop for Android devices
✗ ANDROID_HOME = /usr/local/share/android-sdk
but Android SDK not found at this location.
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[✓] IntelliJ IDEA Community Edition (version 2020.3.2)
[✓] Connected device (2 available)

@alextekartik
Copy link
Contributor

Not sure what is specific about ssh but if indeed the process is spawned without context, there is not much we can do.

You can however try the Shell.kill method to 'kill' the running process in the Shell. See an example here:

import 'package:process_run/shell.dart';

void main(List<String> arguments) async {
  var sw = Stopwatch()..start();
  var shell = Shell();
  // ignore: unawaited_futures
  shell.run('sleep 5');

  await Future.delayed(Duration(seconds: 2));

  // command should last for 5 seconds but we kill it after 2!
  shell.kill();
}

@Gazzolla
Copy link

Gazzolla commented May 31, 2022

How to send crtl +c to shell? i'm runnig node but not kill shell

image

Tried "shell.kill(ProcessSignal.sigint)" but not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants