Giter Site home page Giter Site logo

chell's Introduction

Chell

The chad shell.

Why?

I want to practice C and Vim. That's literally it. That's kinda the whole purpose of the project. I am using Vim as my main text editor and wanted to try it out in an actual small project.

Should I use it?

I don't think so. But go ahead if you want.

How is it chad?

It's not.

Running Chell

Just run gcc -Wall -o chell src/*.c and then ./chell or make && make run from any existing shell and you will get the chell "bash-like" prompt.

Demo

Demo

chell's People

Contributors

gandalf098 avatar jan200101 avatar lordadamson avatar neinkob15 avatar parthav46 avatar ptrstr avatar satharus avatar vamsi995 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

chell's Issues

Add command history

Add command history like in BASH where you can use arrow up and arrow down to cycle previously run commands.

Backspace not working properly

The cursor is not shifted to the right place when using backspace in the middle of a string. While the deleting works, it feels really awkward.

Edit: Please don't use any external libraries, there was a lot of effort put into implementing a minimal readline-like interface which doesn't have external dependencies.

else //not at the end
{
//Shift all to the left
for (int i = *cursor; i < *currentLength; i++)
line[i-1] = line[i];
//decrement the length
(*currentLength)--;
//calculate the number of movements needed forward
int forward = *currentLength - *cursor;
//move to the right
for (int i = 0; i < forward; i++)
{
printf("%c%c%c", 27, 91, RIGHT_ARROW + 'A');
}
//go back and delete on the way
for (int i = 0; i < *currentLength; i++)
{
printf("%s", "\b \b");
}
//move the cursor back
cursor--;
//print the new line
printf("%s", line);
//Go back to the original cursor position
for (int i = 0; i < forward-1; i++)
printf("%c%c%c", 27, 91, LEFT_ARROW + 'A');
}

Ctrl + C exits the shell

Hitting ctrl + c exits the shell, which isn't standard behaviour. The shill should only exit using exit or q. This input should be handled.

Add tab auto-completion

Tab auto completion is pretty much standard on all shells, I've been wanting to add it but anyone is welcome to try this as a Hacktoberfest 2020 contribution :D!

I am trying to keep dependencies to a minimum, so using GNU readline is not an option, sadly.

Command line interface not editable

You can't move between the letters using the left and right arrow keys. The characters ^[[D and ^[[C are written instead.

I am trying to keep dependencies to a minimum, so using GNU readline is not an option, sadly.

"man" won't run

Running man man or man anything leads to this output:

man: can't execute cat: No such file or directory man: command exited with status 255: (cd /usr/share/man && /usr/lib/man-db/zsoelim) | (cd /usr/share/man && /usr/lib/man-db/manconv -f UTF-8:ISO-8859-1 -t ISO-8859-1//IGNORE) | (cd /usr/share/man && tbl) | (cd /usr/share/man && nroff -mandoc -rLL=120n -rLT=120n -Tutf8)

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.