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

Means to say interrupt and execute new command. #29

Closed
GrahamDumpleton opened this issue Jun 1, 2017 · 8 comments
Closed

Means to say interrupt and execute new command. #29

GrahamDumpleton opened this issue Jun 1, 2017 · 8 comments

Comments

@GrahamDumpleton
Copy link
Contributor

Am starting to use oc commands such as oc logs --follow and oc get --watch. These commands will not exit unless you do CTRL-C in the terminal window, which you have to tell users to do explicitly. It may be useful to be able to say for a subsequent command:

``some-command``{{interrupt+execute}}

This would have the effect of sending a SIGINT signal into the interactive terminal session to kill of an existing running command and once that has exited then run the command.

You would only use this where you know you are following up a command which would otherwise keeping running unless interrupted.

@BenHall
Copy link
Contributor

BenHall commented Jun 1, 2017

Ahh, that's a cool idea!

@kameshsampath
Copy link

@GrahamDumpleton @BenHall

In many scenarios we might need the user to run the few commands with doing CTRL + C first,
e.g. in my case i was building a scenario for Spring Boot on OpenShift, where post doing mvn spring-boot:run which starts the app in foreground, I would like the user to do CTRL+C before doing the next command of mvn fabric8:deploy to deploy the application to OpenShift

@BenHall
Copy link
Contributor

BenHall commented Dec 18, 2017

Sorry for the delay on this. Your comment prompted a spark on how it can be implemented.

This is being tested now. The syntax will be:

some-command{{execute interrupt}}

It will execute Ctrl+C before the main command

@kameshsampath
Copy link

that should be cool @BenHall thanks :)

@BenHall
Copy link
Contributor

BenHall commented Dec 18, 2017

This is now live.

@BenHall BenHall closed this as completed Dec 18, 2017
@kameshsampath
Copy link

awesome! thanks :)

@danielhelfand
Copy link
Contributor

@BenHall Is there any way this could be adapted to just run the Ctrl+C? So basically just run Ctrl+C and not execute a command after Ctrl+C.

Or is there a way to only run Ctrl+C in katacoda that I'm not aware of?

@BenHall
Copy link
Contributor

BenHall commented May 15, 2019

No, but you can do some workarounds, such as

: stopped{{execute interrupt}} or clear{{execute interrupt}}

jamesfalkner pushed a commit to jamesfalkner/learn-katacoda that referenced this issue Apr 23, 2020
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

4 participants