A Unix shell written and implemented in rust 🦀

Overview

vsh

A Blazingly fast shell made in Rust 🦀

Installation


Copy and paste the following command and choose the appropriate installtion method for you. You can remove the install.py file afterwards

wget https://raw.githubusercontent.com/Vaimer9/vsh/main/install.py
python3 install.py

About


Why make another shell?

Nushell which is the current leading rust shell, is very opinionated. It brings a lot to the table for someone who just wants a shell but in rust. Namely, a new ls command, new scripting experiece etc. What is missing is just bash written in rust and vsh is here to deliver that. The planned scripting language will be a interchangable with bash and all of its features so that people don't feel homesick or dropped into a new space when they start using vsh. As the for shell prompt I plan to expand upon it to add plugins to accept a wide array of custom plugins all written in vsh. Till then feel free to contribute yourself!

Customization


To customize your prompt you have to edit the .vshrc.json file in your home directory. The file is created when you first open vsh. When initialized the file contains an emtpy json object, i.e:

{

}
Themes

There are two themes with the following properties

  • Classic: double: boolean value and character: string value.
  • Modern: double: boolean value, character: string value, color: List with 3 elements, text_color: List with 3 elements
Double

defualt value: False

Determines wether the prompt will be double lined or single lined eg:

{
	"double": "false"
}

Keep in mind that you have to enter true or false as string i.e inside double quotes

Character

default value: λ

The character that you will have in the starting of the prompt.

Color

default: [109, 152, 134]

Determines background color of modern shell prompt. Eg:

{
	"color": [255, 255, 255]
}
Text Color

default: [33, 33, 33]

Determines text color of modern shell prompt. Eg:

{
	"color": [255, 255, 255]
}

Example Config file

This is the config file personally used by me:

{
	"style": "modern",
	"color": [115, 147, 179]
}

As you can see customizing is not that hard and doesn't require too much code. I will be adding more and more into the level of customization possible!

Roadmap

  • Proper Prompt
  • Run commands
  • Exit with Ctrl+C & Ctrl+D via Rustyline
  • Good looking prompt
  • Multiple Commands
  • Command History
  • Prompt Customization
  • Install Script
  • Piping
  • Command Completion
  • vsh Scripting language 👀
  • Custom ls command
  • Intergration with git, node and cargo
  • Customization via .vshrc
  • Plugin Support (Yikes!)
Comments
  • [Draft] Custom theme

    [Draft] Custom theme

    So this is related to #9 since it will be useful for formatting git infos. Objectives:

    • Provide a way to customize prompt
    • Replace classic, modern and arrow with a corresponding theme file

    Implementation idea: So first of all i had the idea of using a runtime formatting library such as mustache but it would cause problem for text coloring since these formater just replace and not color anything. So we have to implement our parser to do some token recognition. For that there is a library nom well known for parsing byte data and also string. With that in mind i had to think about a theme file syntax. Here is an example i had in mind:

    &[#FF00FF]`[`{{home_dir}}`]`&[#00FF00]{{user_input}}
    

    So

    • &[#FF00FF] tells to color the next string with the corresponding hex color. Everything will have this color until the next &[#00FF00]
    • [ is a string literal so it would be display as [
    • {{home}} is for variable it would be replace with the correct value (for example ~/Documents/vsh). There could be a lot of different variable like time, hostname, user, return code of previous program...

    Anyway here is the current roadmap:

    • [x] Implement a parser
    • [x] Color & replace variables
    • [x] Load theme from config file
    • [x] Flexibility for variables / large choice + documentation
    • [x] Background color
    • [x] Text style (bold italic etc)
    • [x] Allow new line to be added outside string literal
    • [x] Error handling
    • [ ] Non truecolor support
    • [ ] Replace current theme with a theme string using the parser
    opened by MalauD 10
  • Improved Experience

    Improved Experience

    I implemented parsing of any size commands, including using exec as a prefix. I also implemented it in a way that makes it easy to add asynchronous commands (ones that are called ending in "&"): all that has to be done is send them to another thread to be called. I improved install.py by requiring a correct answer instead of simply repeating it, and I implemented a way to preview the releases in the installer, as well as providing a way of installing a default configuration file. Finally, I improved error reporting and fixed crashes in the commands.

    opened by FeistyKit 4
  • Command as prompt (eg. starship)

    Command as prompt (eg. starship)

    Hi there. This looks like a really neat project! I would even consider using it instead of ZSH once piping and the scripting language features are fully implemented 😄

    Even though there isn't any of that yet, I don't see a way for me to run a external command such as Starship as my prompt. Would this be possible to implement?

    feature request 
    opened by theoparis 1
  • Stability

    Stability

    I did a few edits for stability, mostly just to prevent crashing. I also implemented expanding ("~/Downloads" becomes "$HOME/Downloads") in path names, which can be escaped.

    opened by FeistyKit 1
  • README Formatting

    README Formatting

    Remove a lot of the excess HTML in the README and add license to the README.

    The HTML renders differently on different platforms and doesn't look proper now. 2021-12-19_19-32

    opened by coastalwhite 0
  • [Draft] Git support

    [Draft] Git support

    What i want to implement:

    • [x] Current branch and files modified
    • [x] Optionally see how many lines were added/deleted
    • [ ] Customization of how everything is visualized (colors, position) using .vshrc.toml (might require a run time formatting library such as runtime-fmt)
    • [ ] Auto complete on git commands

    Some observation regarding this pr:

    • It introduces a lot of new dependency and some of these are quite heavy (openssl) so may be the choice of git2 is not the best idea. I made this choice because it's quite popular and has every functionality of git.
    • Storing and recreating an instance on every prompt is not ideal, i'm currently looking for a better implementation, if you have any suggestion, please do a suggestion.
    • It might be a good idea to implement git as a plugin
    opened by MalauD 9
Releases(v0.1.19)
Owner
XMantle
XMantle
Safe Unix shell-like parameter expansion/variable substitution via cross-platform CLI or Rust API

Safe Unix shell-like parameter expansion/variable substitution for those who need a more powerful alternative to envsubst but don't want to resort to

Isak Wertwein 4 Oct 4, 2022
skyWM is an extensible tiling window manager written in Rust. skyWM has a clear and distinct focus adhering to the KISS and Unix philosophy.

Please note: skyWM is currently in heavy development and is not usable as of yet. Documentation and versions will change quickly. skyWM skyWM is an ex

MrBeeBenson 74 Dec 28, 2022
a cute shell thingy that written in rust

a cute shell thingy that written in rust

奥田 龍馬 12 Dec 29, 2021
Toy Shell Written in Rust

This is a simple toy shell written in Rust language with porpose of learning system programmim, and in a specific theme, process management.

Júlio César de Brito Gardona 4 May 22, 2022
A Rust curses library, supports Unix platforms and Windows

pancurses pancurses is a curses library for Rust that supports both Linux and Windows by abstracting away the backend that it uses (ncurses-rs and pdc

Ilkka Halila 360 Jan 7, 2023
Just a UNIX's cat copy, but less bloated and in Rust.

RAT The opposite of UNIX's cat, less bloated, and in Rust. About the project The idea of this CLI is "A CLI program that is basically UNIX's cat comma

Renan Fernandes 2 Mar 5, 2022
Library for Unix users and groups in Rust.

uzers-rs Adoption and continuation of the unmaintained ogham/rust-users crate. Big shout-out to its creator Benjamin Sago. This is a library for acces

null 8 Aug 25, 2023
Library for Unix users and groups in Rust.

uzers-rs Adoption and continuation of the unmaintained ogham/rust-users crate. Big shout-out to its creator Benjamin Sago. This is a library for acces

null 8 Sep 18, 2023
A small unix and windows lib to search for executables in PATH folders.

A small unix and windows lib to search for executables in path folders.

Robiot 2 Dec 25, 2021
Reviving the Research Edition Unix speak command

This repository contains the source code of Unix speak program that appeared in the Third (1973) to Sixth (1975) Research Unix editions, slightly adjusted to run on a modern computer. Details on the code's provenance and the methods employed for reviving it can be found in this blog post.

Diomidis Spinellis 31 Jul 27, 2022
Spawn multiple concurrent unix terminals in Discord

Using this bot can be exceedingly dangerous since you're basically granting people direct access to your shell.

Simon Larsson 11 Jun 1, 2021
fcp is a significantly faster alternative to the classic Unix cp(1) command

A significantly faster alternative to the classic Unix cp(1) command, copying large files and directories in a fraction of the time.

Kevin Svetlitski 532 Jan 3, 2023
A tool for automating terminal applications in Unix.

expectrl A tool for automating terminal applications in Unix. Using the library you can: Spawn process Control process Expect/Verify responces It was

Maxim Zhiburt 132 Dec 14, 2022
Modern file system navigation tool on Unix

monat -- Modern file system Navigator 简体中文 Introduction monat is a Unix shell auxiliary command focusing on the navigation of the file system, especia

Pavinberg 8 May 10, 2022
FreeDesktop-compliant trasher for Unix

to-trash ?? to-trash (tt for short) is a fast, small, and hopefully FreeDesktop-compliant file trasher for Linux. Compliance tt aims to have complianc

Vinícius Miguel 22 Aug 19, 2022
xcp is a (partial) clone of the Unix cp command. It is not intended as a full replacement

xcp is a (partial) clone of the Unix cp command. It is not intended as a full replacement, but as a companion utility with some more user-friendly feedback and some optimisations that make sense under certain tasks (see below).

Steve Smith 310 Jan 5, 2023
Superviseur - A simple process supervisor for UNIX-like systems

A simple process supervisor for UNIX-like systems. Currently supports non-containerized services. Containerized services and wasm services will be supported in the future.

Tsiry Sandratraina 25 Mar 28, 2023
Convert a unix timestamp (seconds) to a struct {year, month, day, hour, minute, second, weekday}.

uts2ts uts2ts is a simple function that does only one thing: It converts a unix timestamp to something slightly more useful. ;-) So why then? Well, it

Helmut K. C. Tessarek 6 Jul 26, 2023
A lightweight terminal tool to manage processes in Unix machines.

TTV v0.0.1 TTV (term-task-viewer) is a lightweight tool to view and manage active processes in Unix machines. It provides an easy interface with vim-l

Caio Ishikawa 9 Aug 29, 2023