magic to return exit status
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
IPython |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
what im suggesting is basically something similar to $? in bash to get the exit status, both for magic functions, and normal programs run through the shell.
At the moment there isn't a way (that ive discoved) of checking if a magic function successfully did what it was supposed to, and no way of returning an exit status without it displaying on screen.
example: i wrote a magic to cd to a directory and ls its contents (cdl), the obvious way would be to use the existing cd command, except you can't test if its run successfully.
i know you can use the subprocess or commands module to get exit codes but its not straight forward and has the disadvantage that you can't check after the fact if a program exited successfully.
anyway thank great program, i basically use it as my default shell now.
This is a very reasonable request. Probably best considered once we refactor the magics so they all share a base class, where this behavior can be implemented in a consistent manner. So this is at least post 0.10, and likely post 0.11, since I'm sure the magic reorg will take some serious effort.