Use exit() or Ctrl-D (i.e. EOF) to exit
Gets me more often than I'd like to admit. Use exit() or Ctrl-D (i.e. EOF) to exit
Gets me more often than I'd like to admit.Thanks, tcsh. Now I remember why I don't use you.
Use exit() or Ctrl-Z plus Return to exit
Well, first, there is no Return key on any PC keyboard I've seen in a very long time. There is an Enter key.But that's minor. The bad part is if I'm used to Linux and try to exit on Windows with Ctrl+D, I get this cryptic message:
>>> ^D
File "<stdin>", line 1
♦
^
SyntaxError: invalid syntax
>>>
Suppose it's the other way around: I started out as a Windows user and got accustomed to using Ctrl+Z to exit.Now what happens if I switch to Linux (as an inexperienced Linux user) and try to use Ctrl+Z to exit? Yes, I get this somewhat cryptic message:
>>>
[1]+ Stopped python
mike@s:~$
Now, you know that I haven't exited Python at all but have merely backgrounded it, but remember I'm an inexperienced Linux user and don't know about fg and bg and stuff like that yet. So every time I "exit" from Python I've added another background task. Oops.If you prefer you can use another pager like more that will let you ctrl-c:
export PAGER=more
Or activate the -K option of less that will quit on ctrl+c export PAGER='less -K'If your state is just sitting in the file, interpret the signal as exit.
As another example, perhaps it would be nice if ctrl-w deleted one word backwards if you were currently editing text in your webbrowser, but close your current tab/window otherwise. If the state is always what the user expects when they press ctrl-w it would work fine, but in reality you would have lots of people accidentally closing tabs.
Ctrl+C doesn't mean "end this program." If you want that, consider Ctrl+\.
It enables you to search using '/keyword', for example.