Questions tagged [control-c]

30 questions
1
vote
1 answer

Can I make sure my timer-started threads run to completion if the VM is shutdown by Control-C?

Suppose I make a few calls to the following function: public void StartTimedRuns(){ Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask(){ public void run(){ //do something that takes less than a minute …
merlin2011
  • 71,677
  • 44
  • 195
  • 329
1
vote
0 answers

bash trap ctrl c and continue to next function

#!/usr/bin/env bash # trap ctrl-c and call ctrl_c() trap ctrl_c INT function ctrl_c() { echo echo "** Trapped CTRL-C: Skipping Current Task **" echo } function ping1 () { sudo ping 8.8.4.4 sudo ping 1.1.1.1 } function ping2…
Anubhav
  • 11
  • 2
1
vote
2 answers

Detect Ctrl+C in Java Console

I have a Console-Java game. The score from the game will be saved in a JSON file if Ctrl+C is pressed. The process to save the score in a JSON file works. But I don't know, how to detect Ctrl+C from the console and if this happens, I will save the…
SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34
1
vote
1 answer

In ABCL how do I break from a runaway function without killing LISP?

In ABCL, during development I sometimes get runaway functions. I want to be able to stop execution and return to top level LISP without killing the LISP/JVM process (in my emacs shell) and losing my current LISP environment. I've tried various…
1
vote
1 answer

Perl script to stop bsub job when control c is pressed

I am running a perl script which internally launches bsub jobs . I wanted to kill all jobs launched by this perl script when control c is pressed in unix terminal when i run the perl script based on the group id . Please advise. Thanks &…
Chinnu
  • 45
  • 1
  • 6
1
vote
1 answer

Can not get keyboardInterrupt to catch ctrl c in python program running in linux

I want my program to stop executing when a ctrl-c is entered in the terminal window (that has focus) where the program is executing. Every google hit tells me this should work but it doesn't. First I tried putting the try block in a class method my…
0
votes
1 answer

Why does active_record break the behavior of Ruby's trap and how do I work around it?

In the last couple of days, I've been trying to get a solution to an active_record issue that has been plaguing me. Posts on railsforum and stackoverflow have turned up completely dry. The length and level of detail in those posts may have…
Sniggerfardimungus
  • 11,583
  • 10
  • 52
  • 97
0
votes
1 answer

Python script in Git Bash ignores keyboard interrupt Control C

Python script in Git Bash ignores keyboard interrupt Control C when running the script directly. This is a simple code to test, called test_sleep_interrupt.py. It sleeps 10 times, 1 second each time. I will type Control C in between. #!/usr/bin/env…
oldpride
  • 761
  • 7
  • 15
0
votes
1 answer

How to terminate spring boot application process in Windows by pressing Control-C?

If I run a spring boot application from within a Windows Command Prompt (using java -jar), and I press Control-C to terminate the process, I get the following console output, and the process remains opened: 2017-11-27 20:15:22,713 INFO [Thread-11]…
Funky Fish
  • 31
  • 4
0
votes
1 answer

How to terminate only the inner batch job

Let's say there is some .bat file that is required to run inside .cmd batch script. This inner .bat file has a series of user interactions on a local host, and are only able to be ended using ctrl+c. The question is: Is there some way to make the…
xandermonkey
  • 4,054
  • 2
  • 31
  • 53
0
votes
1 answer

How is Ctrl+C key behaves in a TCP connection

I'm studying network and specifically tcp connection and i wondering in a situation that you connect remotely to a server using tcp connection and sending command line to execute some actions, How they handle sending a ctrl+c signals? Is it sends a…
dev-masih
  • 4,188
  • 3
  • 33
  • 55
0
votes
2 answers

Handling CTRL-C in dummy shell

I'm writing a dummy shell that should not terminate when the user types ctrl-C but should just generate a new prompt line. Currently, my shell does not terminate when I type ctrl-C but it still does not print the new prompt line. Do you know why…
user2264035
  • 565
  • 1
  • 7
  • 13
0
votes
2 answers

Need to highlight and copy text from google doc viewer to clipboard

I have to create a process where a document is shown to the user and the user can highlight text and copy (and eventually paste) the text from some portions of the document. I am using google doc viewer in an iframe (since I need a universal doc…
Arthur Frankel
  • 4,695
  • 6
  • 35
  • 56
0
votes
1 answer

How to disable Control-C in a WindowsXP Python console program?

I'd like to put my cmd.com window into a mode where Control-C does not generate a SIGINT signal to Python (ActiveState if it matters). I know I can use the signal module to handle SIGINT. The problem is that handling SIGINT is too late; by the time…
-3
votes
2 answers

why socket on the receiving peer keep receiving '' infinitely when I use "control-c" to close the socket on the sending peer

I'm a newbie to socket programming, I know it's a bad habit to close socket using "control-c", but why socket on the receiving peer keeps receiving '' infinitely after I use "control-c" to close the sending process? shouldn't the socket on the…
qifan
  • 7
  • 1
  • 2
1
2