Add init_environment(), %less, %more, %man and %clear/%cls, in zmq shell.
These are all things that normally need direct terminal control and
users are likely to call them via !, blocking their session because
the pager will be invoked and we can't pass keystrokes to it.
So for the zmq shell, we implement a few very common things as magics.
Implement support for 'cell' mode with Ctrl-Enter.
Now, once c-enter has been used, the widget will continue accepting
more input just as if the input was indented: even complete
expressions won't trigger execution, until an extra blank line (or
Shift-Enter) is used.
Aliases fixes: ls alias improvements and frontend-dependent fixes.
Isolated some aliases to the classes that can only run in certain
frontends, so we don't try to call 'clear' on the Qt terminal (which
doeesn't work).
Fix bugs in x=!cmd; we can't use pexpect at all.
pexpect makes the subprocesses format their output for a terminal,
with a mix of spaces, tabs and newlines. This makes it virtually
impossible to then capture their output and do anything useful with it.
Fixed a few other small bugs and inconsistencies in process handling.
ConsoleWidget now manually controls the vertical scrollbar.
As a result, Ctrl+L works as expected. Additionally, the prompt does not "jump around" while scrolling through history.
Fixed ANSI compliance issue in AnsiCodeProcessor.
Among other things, this fixes 'ls' on Mac OS. I also added a safety SGR reset in FrontendWidget to prevent bad ANSI codes from hosing the input buffer.