1

If I type a command, and halfway through I decide not to run that command, I do a Control-C to cancel it without having to backspace the whole thing, e.g. mv foo.txt bar.txt. On Ubuntu it'll show up as mv foo.txt bar.txt^C to remind me I cancelled it, but on Mac it shows up as just mv foo.txt bar.txt. Any way to get that ^C behaviour on Mac?

6
  • It shows ^C for me in Terminal under OS X 10.8.5. What version of OS X are you running? Commented May 10, 2016 at 13:26
  • I'm on 10.10.5. It shows up when a cancel a process halfway through, but not when I press Control-C before even hitting Enter
    – Tan Wang
    Commented May 10, 2016 at 14:01
  • @user3439894 I'm running 10.11.1 and it doesn't show ^C for me, either.
    – Munesawagi
    Commented May 10, 2016 at 14:35
  • @user3439894 Maybe it only shows ^C in older versions?
    – Munesawagi
    Commented May 10, 2016 at 14:36
  • 1
    Try updating bash with homebrew if that's what you use
    – 0942v8653
    Commented May 10, 2016 at 16:32

2 Answers 2

0

I'm not entirely sure of this, but for a different reason I upgrade the Bash on my machine (brew install bash) and this behaviour started to show up. This post is what I followed to update Bash. It would be good practice not to overwrite your old Bash but instead just use the new one. Brew puts the new Bash at /local/usr/bin/bash anyway.

-1

On most Unix systems you can modify the shell to either show the output of the control character as the character or as a "^C". This can be done with the echoctl or ctlecho stty modes.

Use stty echoctl to print the ^C characters

and stty -echoctl to allow the shell to print the control character as the actual character, a SIGINT in this case.

Doing this on a Linux machine seems to alter the behavior correctly, but on my MAC it will not show the character either way, on 10.11.something.

1
  • From your last sentence this is not an answer
    – mmmmmm
    Commented May 10, 2016 at 16:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .