Git Product home page Git Product logo

emsh's Introduction

EMShell


Eric Marshall

Usage

  1. Make sure the D language is enabled (on the lab machines, run module load csci208/langs)
  2. Run makefile with make
  3. Run the shell with ./emsh

What is EMShell?

EMShell is a command line shell that is designed to work similarly to the Bash shell. The EMShell supports the cd command, tab to autocomplete directory names, exit, as well as running other command line programs. The left and right arrow keys can be used to move the cursor, and backspace can be used to remove characters, either from the end or in the middle of the string. The up and down arrow keys support a session command history, with up being the previous command in the list and down being the next one.

Why a shell in D?

D is built to be a concise language that allows for high-level programming while still being very low overhead. One of its abilities is to be able to use C libraries directly. In order to get much of the functionality of the shell's input, we need to use noncanonical input (read character-by-character instead of dumping the entire line on a newline being entered), which is only possible using C APIs. This makes D perfect for building a shell, because it allows for sophistocated string manipulation functions while still giving access to the low-level API's when needed.

NOTE ABOUT CRASHES:

The shell is NOT perfect! There are still some bugs, and if it crashes while collecting input from the user, there is a chance that your terminal session will be left in noncanonical mode. To fix this, the only solution is to close that shell and open a new one!

Shell Features:

  • cd [path] - Change the directory to the one specified by path - Note: ~ expansion is buggy - relative paths and absolute paths should work
  • exit - Exit the shell
  • tab - Tab will present autocomplete suggestions and complete filenames when entering paths - Note: still buggy
  • arrow keys/backspace - The arrow keys and backspace allow for editing input lines and traversing through the command history for the session.

emsh's People

Contributors

egoodhall avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.