Git Product home page Git Product logo

lterm's Introduction

		     __       ________   _______   _____   _     _    __
		    |  |     |__    __| |   ____| |  _  | | \   / |   \ \           
		    |  |        |  |    |  |__    | |_| | |  \_/  |    \ \          
		    |  |      o |  |    |     |   |   __| |   _   |     \ \         
		    |  |      o |  |    |   __|   |   \   |  | |  |     / /         
		    |  |____  o |  |    |  |____  |    \  |  | |  |    / / ____   
		    |_______| o |__|    |_______| |__|\_\ |__| |__|   /_/ |____|  

lterm: Online bash terminal(emulator) tutorial

Check out the site live at: lterm Gitter

lterm is an online Terminal Emulator. It is a step by step tutorial that will teach you the bash commands by making you execute them.

Nothing is better than learning by doing.

It is fully online and doesn't require any extra shitty access. Being an emulator, it only virtualizes a terminal environment and so the commands executed doesn't effect either the server or your local machine.

List of commands available presently

Command Does...
echo To display a string
pwd Shows you the present working directory
ls Lists all the files
cd To change directory - change the current working directory to a specific directory
cd .. Moves you up one directory(parent)
cat Concatenate and print the content of files
clear Clears the terminal screen
touch Changes file timestamps or creates a new file
cp/mv To copy/move files
rm Delets a file/directory
uname Shows the name of the Linux/Unix system you are using
date Shows the local standard date & time
ifconfig Shows information about active network interfaces.
mkdir Creates a new directory
tty Prints the file name of the terminal connected to standard input
history Shows all the commands which are used in the previous iterations

List of commands that can be added

  • export
  • less
  • more

Contributing

  1. Fork it (https://github.com/sr6033/lterm/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

To add your new commands

  • edit the file main.js to add your commands.
  • You don't have to worry about any other files or programs.

  • If a command doesn't need further steps:
// without argument
ls: function() {
        this.echo('This is the ls command\n');
}
// with argument
echo: function(arg1) {
        this.echo('This is the echo command' + arg1 + '\n');
}
  • If a command needs further steps:
cd: function(arg1) {
	this.push(function(cmd, term) {
                if(cmd == 'another_command')
                    this.echo('another_command');
		}, {
                    prompt: '[[b;#44D544;]lterm@localhost/' + arg1 + ':~$] ',
                   }
        );
}

IMPORTANT

  • On addition of a new command, increase the size of arr array. This array acts like a counter to check if a task/command is completed or not.
  • You need to add the new command into the second array arr2 . This array stores all the commands and helps in fetching the completed commands when the history command is executed.
  • Please make sure that you do not alter the positions of commands in arr2, You need to add the new command towards the last.
  • Example: If I add the command - echo. I will add another 0 to the end of arr. Then I will make arr[index] = 1 under echo command.
var arr = [0,0,0,0,0,0,0,0,0,0,0,0,0,0]; // Will add another 0 here. The place where you added is the index.
var arr2 = ['list of all other commands']; // Will add the 'echo' command here
...
...
echo: function(arg1) {
            arr[index_where_you_added_0] = 1;	// Will make the value at that index to 1. 	
            this.echo(arg1 + '\n');
            this.echo('> The [[b;#ff3300;]echo] command prints back your arguments.');
            this.echo('> Type [[b;#ff3300;]help] and check your first task is completed.');
            this.echo('> Now type [[b;#ff3300;]pwd] to continue.');
},

  • If you face any problem or cannot understand anything, open up an issue.
  • You can also edit the readme and make it more user friendly to help out new contributors.

NOTE: Kindly keep the display of the terminal intact while making an update. A single extra space can make the look of the emulator little odd. So keep that in mind while printing something using echo command.

Note: Kindly have interpretable & good commit messages. Don't assume me to be some Jedi with powers to be able to make out every commit with a single word as message. May the Force be with you.

lterm's People

Contributors

agarwalprashasti avatar bluez-sh avatar jez321 avatar logan1x avatar melsener avatar nvinayvarma189 avatar rupesh1310 avatar shivhek25 avatar sr6033 avatar srishag avatar vitordiass avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

lterm's Issues

cd command

I was trying commands on the website then I found that only cd is not working. This should work. Because by cd, we can go directly to the home directory.

cd command

Make it mobile responsive

As of now the terminal is not fully mobile responsive. The top part of the terminal gets disfigured in mobiles. And also it opens in a full-screen mode, not responsive mode.
screenshot from 2017-11-26 12-22-44

History command doesn't work as it should.

history command should display all the commands used in the terminal along with the arguments and if a command is used multiple times then the history command is supposed to display that command multiple times in the correct order.

"cd .." doesn't fulfill its purpose

"you will get something like -> /home/lterm/ since you were on /home/lterm/Documents
Type cd ~ to continue
Type exit to exit cd command and then cat hello.txt to continue."
This is displayed but the directory isn't changed.

update README.md

There is a new command added and it is not listed in the readme file and also there is a slight change that needs to be added in the important instructions for the history command . I would like to work on it

Need help with adding commands.

I wanted to add the more and less commands. As we know, these commands require access to a file which will shown partially or be scrollable. How do I go about accessing the file using the code for these commands ?

Scroll to bottom don't work in Chrome

If you type commands that don't fit on terminal it don't scroll to bottom and it should, it was bug in jQuery Terminal caused by update of google chrome that was fixed in some of the newest versions of the library.

If you open the app in Firefox this is how it should work. if you press and hold enter you will always see the cursor.

Add fully working redirection (< and >)

The redirection > and < are used in a bash terminal to redirect the outputs and inputs. Try to implement those in this online emulator.
Example:
The output is getting stored in a out.txt file.

./a.out > out.txt

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.