IonicaBizau / web-term

:tv: A fullscreen terminal in your browser.
MIT License
169 stars 21 forks source link

How to write data #14

Closed rtwk closed 9 years ago

rtwk commented 9 years ago

There is a data option to write data to the terminal. Any example would be of great help.

IonicaBizau commented 9 years ago

Hey @rtwk! Can you please tell me more about what you're trying to do?

rtwk commented 9 years ago

Hi. When I start web-term from terminal (issuing web-term -p 5000 -c dir), does it have any option to issue a command to be executed automatically when the app starts (e.g. run a python program with say 'python filename.py')?

IonicaBizau commented 9 years ago

Ah, there is not such option. At least not yet. :smile:

But that's a neat idea. If you like, you can implement that and make a pull request.

Btw, remember you can run scripts using the .bashrc file.

rtwk commented 9 years ago

Okay.

IonicaBizau commented 9 years ago

Just tested it: add the following line in your ~/.bashrc (or ~/.bash_profile on OS X):

echo "Hello World"

Then, when you open the terminal, Hello World will appear. :sparkles: So, I'm closing this.

IonicaBizau commented 9 years ago

This is now possible in 3.1.0–check out #18. Using web-term -s alsamixer will start alsamixer for example. :smile:

rtwk commented 9 years ago

That's awesome.

On Sun, Aug 23, 2015 at 4:52 PM, Ionică Bizău notifications@github.com wrote:

This is now possible in 3.1.0–check out #18 https://github.com/IonicaBizau/web-term/pull/18. Using web-term -s alsamixer will start alsamixer for example. [image: :smile:]

— Reply to this email directly or view it on GitHub https://github.com/IonicaBizau/web-term/issues/14#issuecomment-133818765 .

IonicaBizau commented 9 years ago

I pushed an additional fix for running custom commands at the start. If you really want to run a program (e.g. alsamixer) in the browser, you should do: web-term -b alsamixer.

If, for example, you like to run a custom command in a different shell, you should do: web-term -b zsh -s 'echo "Hello World"'–this will start zsh (instead of bash) and will run echo "Hello World" there. :smile: