Giter Site home page Giter Site logo

rapha8l / pshell Goto Github PK

View Code? Open in Web Editor NEW

This project forked from philipprados/pshell

0.0 0.0 0.0 603 KB

A C-shell with integrated fuzzy finder, tab completion and more using no external libs

License: MIT License

Ruby 18.20% C 80.02% Makefile 1.43% Dockerfile 0.35%

pshell's Introduction

A C-shell with integrated fuzzy finder, tab completion, all standard shell features and more without using curses.

ViewCount

Table of contents

Features

Tab-completion Fuzzy-finder Autocompletion
Wildcard-matching Syntax highlighting

Syntax

Besides the basic && to chain multiple commands, | to pipe one output to another, * and ? for wildcard matching here are some more psh syntax elements:

Input/Output Redirection
> or 1>   stdout redirection
>> or 1>> output append
2>        stderr redirection
2>>       stderr append
<         input redirection
&>        merge stdout, stderr into single file
&>>       append merge stdout, stderr to single file
Fuzzy-finder
<ctrl-f> to open
<ESC>    to close
<Enter>  to choose proposal
Quoted arguments
echo 'this argument counts as single arg' # currently only single quotes supported
echo you\ can\ also\ escape\ whitespace\ with\ backslash

Setup

You only need make and gcc to build. Also your terminal should be capable of displaying unicode characters.

$ git clone https://github.com/PhilippRados/PShell
$ cd PShell
$ make
$ echo /usr/local/bin/psh | sudo tee -a /etc/shells

If you want to install it somewhere else due to permission error in default-path make INSTALLDIR=<custom-path>.
When successfully executed the commands above you can change psh to your default shell like so:

$ chsh -s /usr/local/bin/psh

You can use this same command to change your shell back to your original one just swap out the path.

When first starting the shell you'll be prompted with an option to create a ~/.pshrc file when you don't have one. This will set basic ENV-variables needed to run the shell.

# ~/.pshrc
PATH="some/interesting/path/$" # use $ to append to already extistant env-variable
TERM="linux"                   # without $ any existant env-variable gets overwritten

Testing

  1. Unit_tests: This requires the https://criterion.readthedocs.io/en/master/ testing lib for C. When you have installed that you can run:
    $ make run_tests              # to run all tests
    $ make <file_name without .c> # to run specific tests
  2. Integration_tests:
    $ docker build -t testing_container . # have to setup docker container for tests to run in
    $ make integration_tests              # starts running integration tests in testing_container

Contribution

If you find any bugs or some other kind of issue it would be great if you can open an issue. If you want you can of course also contribute with PRs which should just pass all tests to make sure they don't break anything.

Future Work

  • Implement local session ENV-variables using export and echo $SOME
  • Have builtin command to search through past commands' output
  • Allow for aliasing in ~/.pshrc
  • Allow for inplace variable execution
  • Improve fuzzy-finding algorithm
  • support utf-8 instead of only ascii

pshell's People

Contributors

philipprados 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.