Control-C kills Ipython in git bash on Windows 7
Asked Answered
N

1

3

After so many years cruising on Linux, I am back on a freaking Windows environment. I use Ipython, and I launch it in git bash. It would be hard for me to use something else, since the environment is configured to use this at my office.

So, when I launch Ipython, and I mistakenly launch an infinite loop, or some bad code that takes ages to execute, I use ctrl-c.

This kills Ipython, and it's pretty annoying. I did not find any way to circumvene this or another key that would do the trick.

Any ideas would be highly appreciated.

Thanks a bunch

Nymphalid answered 15/5, 2014 at 12:19 Comment(1)
btw, it's the same with python, not only ipythonNymphalid
N
5

I actually found an elegant solution. I put this in my .bashrc:

alias p="trap '' 2; ipython;trap 2;"

that way, ctrl-c signal (which code is 2) gets trapped before launching it, and untrapped when exiting ipython.

Nymphalid answered 15/5, 2014 at 13:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.