Rsh as a Shell

The Rsh Fundamentals and Programming in Rsh chapter focused mostly on the language aspects of rsh. This chapter sheds the light on the parts of rsh that are related to the rsh interpreter (the rsh REPLopen in new window). Some of the concepts are directly a part of the rsh programming language (such as environment variables) while others are implemented purely to enhance the interactive experience (such as hooks) and thus are not present when, for example, running a script.

Many parameters of rsh can be configured. The config itself is stored as an environment variable. Furthermore, rsh has several different configuration files that are run on startup where you can put custom commands, aliases, etc.

A big feature of any shell are environment variables. In rsh, environment variables are scoped and can have any type supported by rsh. This brings in some additional design considerations so please refer to the linked section for more details.

The other sections explain how to work with stdout, stderr and exit codes, how to escape a command call to the external command call, and how to configure 3rd party prompts to work with rsh.

An interesting feature of rsh is shells which let you work in multiple directories simultaneously.

rsh also has its own line editor Reedline. With rsh's config, it is possible to configure some of the Reedline's features, such as the prompt, keybindings, history, or menus.

It is also possible to define custom signatures for external commands which lets you define custom completions for them (the custom completions work also for rsh custom commands).

Coloring and Theming in Rsh goes into more detail about how to configure rsh's appearance.

If you want to schedule some commands to run in the background, Background task in Rsh provide a simple guideline for you to follow.

And finally, hooks allow you to insert fragments of rsh code to run at certain events.