What’s different about Murex’s interactive shell?
Aside from Murex being carefully designed with scripting in mind, the interactive shell itself is also built around productivity. To achieve this we wrote our own readline library. Below is an example of that library in use:
The above demo includes the following features of Murex’s bespoke readline library:
cd
)kill
where the process ID was substituted when selected)cd
and kill
- enabled by pressing [ctrl]
+[f]
)vi
in the example - enabled by pressing [esc]
followed by [v]
)[esc]
)Murex uses a custom readline
library to enable support for new features in addition to the existing uses you’d normally expect from a shell. It is because of this, Murex provides one of the best user experiences of any of the shells available today.
A full breakdown of supported hotkeys is available in the terminal-keys guide.
Autocompletion happen when you press [tab]
and will differ slightly depending on what is defined in autocomplete
and whether you use the traditional POSIX pipe token, |
, or the arrow pipe, ->
.
The |
token will behave much like any other shell however ->
will offer suggestions with matching data types (as seen in runtime --methods
). This is a way of helping highlight commands that naturally follow after another in a pipeline. Which is particularly important in Murex as it introduces data types and dozens of new builtins specifically for working with data structures in an intelligent and readable yet succinct way.
You can add your own commands and functions to Murex as methods by defining them with method
. For example if we were to add jq
as a method:
method define jq {
"Stdin": "json",
"Stdout": "@Any"
}
Like with most IDEs, Murex will auto close brackets et al.
Pipelines in the interactive terminal are syntax highlighted. This is similar to what one expects from an IDE.
Syntax highlighting can be disabled by running:
config set shell syntax-highlighting off
Murex supports inline spellchecking, where errors are underlined. For example
This might require some manual steps to enable, please see the spellcheck user guide for more details.
The hint text is a (typically) blue status line that appears directly below your prompt. The idea behind the hint text is to provide clues to you as type instructions into the prompt; but without adding distractions. It is there to be used if you want it while keeping out of the way when you don’t want it.
Murex supports a couple of full screen preview modes:
Enabled via
[f1]
This displays a more detailed view of each parameter you’re about to pass to a command, without you having to run that command nor leave the half-completed command line.
It can display: * man
pages * custom guides like https://cheat.sh and AI generated docs * information about binary files * contents of text files * and even images too!
Enabled via
[f9]
The Command Line Preview allows you to view the output of a command line while you’re still writing it. This interactivity removes the trial-and-error from working with complicated command line incantations. For example parsing parsing complex documents like machine generated JSON becomes very easy.
This does come with some risks because most command line operations change you systems state. However Murex comes with some guardrails here too:
[f9]
to re-run the entire pipeline.config
. For example:
» config get shell safe-commands -> tail -n5
td
cut
jobs
select
dig
A common behaviour for command line users is to copy and paste data into the terminal emulator. Some shells like Zsh support Bracketed paste but that does a pretty poor job of protecting you against the human error of pasting potentially dangerous contents from an invisible clipboard.
Where Murex differs is that any multi-line text pasted will instantly display a warning prompt with one of the options being to view the contents that you’re about to execute.
This gives you piece-of-mind that you are executing the right clipboard content rather than something else you copied hours ago and forgotten about.
Errors messages in most shells suck. That’s why Murex has taken extra care to give you as much useful detail as it can.
method
): Define a methods supported data-typesconfig
): Query or define Murex runtime settingsruntime
): Returns runtime information on the internal state of Murexautocomplete
): Set definitions for tab-completion in the command line->
Arrow Pipe: Pipes stdout from the left hand command to stdin of the right hand commandonPreview
: Full screen previews for files and command documentation{ Curly Brace }
: Initiates or terminates a code block|
POSIX Pipe: Pipes stdout from the left hand command to stdin of the right hand commandThis document was generated from gen/user-guide/interactive-shell_doc.yaml.
This site's content is rebuilt automatically from murex's source code after each merge to the master
branch. Downloadable murex binaries are also built with the website.
Last built on Tue Dec 10 22:56:57 UTC 2024 against commit 60f05a260f05a227caf73dd5b3478e3cb3f4bb24e46745b.
Current version is 6.4.1005 (develop) which has been verified against tests cases.