Coder Social home page Coder Social logo

rohanchandra / javascript-terminal Goto Github PK

View Code? Open in Web Editor NEW
118.0 118.0 37.0 413 KB

JavaScript terminal emulator library that works in Node.js and your browser.

Home Page: https://rohanchandra.gitlab.io/javascript-terminal/demo/

License: MIT License

JavaScript 99.51% CSS 0.25% HTML 0.24%
javascript terminal

javascript-terminal's People

Contributors

csprance avatar mrrosoff avatar rohanchandra 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  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

javascript-terminal's Issues

Case sensitivity of commands and execution

I am using redux-saga and integrating that with the related project react stateless terminal component.
When the stateless component hits enter / submit, it executes the command in the emulator.
https://github.com/rohanchandra/react-terminal-component/blob/29ea72b33fbcd72ab72c37068eb45e1a1cfef33f/src/ReactTerminalStateless.js#L45-L46

This is okay- I have the commands respond blank and then my asynchronous redux-saga appends its output before saving the state.

However, my use case requires case insensitivity. The emulator command mappings and execution seem to be case-sensitive. So when I use a command where the case does not match, it outputs the error message (before my appended output). "Command not found"

Maybe a flag or argument should be created for case insensitive execution? I suppose it could be done by defaulting to lower case version or upper case version of whatever is passed. Then, documenting which case to use to have case insensitivity.

Prompt Yes or No before executing a command?

I need to prompt the user "are you sure you want to do this?" and allow them to enter Y or N to continue executing the command.

Any ideas on how I could achieve this using javascript-terminal?

Clicking anywhere in the terminal should select it

When you have an actual terminal clicking anywhere within it will have it ready to type into.

In your terminal simulator demo, you have to click where you are typing. Kind of annoying for someone that uses a terminal a lot.

shell scripts

Whats the best way to run a series of commands a la a shell script?

Unknown command handler?

Is there a way to customize the behavior when an unknown command is passed to the terminal? I'd like to simply forward the input from the terminal to another service and have the output from that service displayed in the terminal.

Streaming output of a command to the console

I have a usecase where I want a command to open up a websocket and whatever data comes in on that websocket I would like to display on the terminal output.

Now the problem I have is currently all commands have to look like this:

  return {
    output: OutputFactory.makeTextOutput(input)
  };
},
'optDef': {}

}

They all have to "return" a single TextOutput which doesn't allow me to stream my data onto the console output.

Any ideas on how I can do this?

Pipes?

Would it be possible to implement piping in this? ">" or ">>".

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.