This library provides some basic (POSIX) shell commands defined in
Prolog, such as pwd and ls for situations
where there is no shell available or the shell output cannot be
captured. Note that in recent versions (since 10.1.13) the GUI frontend swipl-win
can capture process output on all supported platforms.
The shell's exit status is not our business, so shell/0 succeeds whatever it is. Note that if the shell cannot be executed shell/2 raises an exception.
shell
%comspec% (Windows only)
$SHELL
ls -F, flagging directories with /.
If the terminal supports it, Prolog source files are rendered as links
using the OSC 8 escape sequence. When using Epilog, clicking a Prolog
file opens it in the editor.| Style | is either url to make a
hyperlink or a valid style argument for ansi_format/3. |