Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple echo demo for web terminal? #96

Open
billyzkid opened this issue Jan 27, 2017 · 13 comments
Open

Simple echo demo for web terminal? #96

billyzkid opened this issue Jan 27, 2017 · 13 comments

Comments

@billyzkid
Copy link

The existing demos I've seen demonstrate socket/pty/node integration with the xterm Terminal control, but what if I have a much simpler use case. I'd like to see a simple client-side-only "echo" demo -- display a prompt, read the user's input and echo it back out.

I see the existing demo alludes to a "fake" terminal which displays a prompt and writes keyboard input, but this does not show me how to read the user's input (especially when it spans multiple lines), how to wire up a standard keyboard shortcut (e.g. ctrl-c), etc.

Also, copy/paste and backspacing across multi-line input does not seem to be working in this scenario out-of-the-box so that would be nice to see too.

@billyzkid billyzkid changed the title Simple echo/prompt demo for browser-only terminal? Simple echo demo for web terminal? Jan 27, 2017
@vincentwoo
Copy link

To piggyback off this, I also think that the latest release should have a simple demo as described above available at http://xtermjs.org/

@Tyriar
Copy link
Member

Tyriar commented Jan 28, 2017

Seems like it would be a good improvement to add an input listener to the quick start 👍

@parisk
Copy link
Contributor

parisk commented Jan 30, 2017

Good idea. I'll open up a branch in https://github.com/xtermjs/xtermjs.org.

@BenHall
Copy link

BenHall commented Feb 4, 2017

Katacoda is available for you if it's useful? Would users to deploy the node sample app without having to configure anything...

@parisk
Copy link
Contributor

parisk commented Feb 5, 2017

Thanks @BenHall for offering! Can you get into a little bit more details about what would this Node app do?

What might be useful would be if each visitor could get an actual Bash terminal connected to the front-end, but this is quite the opposite of the current issue.

@vincentwoo
Copy link

We at CoderPad might be willing to sponsor this demo in the future! We run a shit-ton of containers constantly, anyhow.

@InDieTasten
Copy link
Contributor

Is this completed? Where can I find it?

@parisk I cannot find a branch besides master publicly available on GitHub

@DRSDavidSoft
Copy link

Subscribed for updates regarding this

@LucianBuzzo
Copy link

We're using a simple client side javascript REPL to demo our Terminal component (which wraps xterm) in rendition, you can see it in action here https://resin-io-modules.github.io/rendition/?selectedKind=Terminal&selectedStory=Standard&full=0&addons=1&stories=1&panelRight=0&addonPanel=storybook%2Factions%2Factions-panel
Some of the source code could be leveraged to build a simple demo

@santosh0705
Copy link

@LucianBuzzo could you share some more information or some demonstration code.

@LucianBuzzo
Copy link

@santosh0705 Here is the source code for a simple JS repl tethered to an xterm.js instance https://github.com/resin-io-modules/rendition/blob/master/src/stories/Terminal.js#L44
In the Rendition library, we add a simple wrapper around the xterm.js instance and expose it as this.tty.

@wavesoft
Copy link

If you want a more elaborate local-echo controller, you could use this : https://github.com/wavesoft/local-echo

@Tyriar Tyriar transferred this issue from xtermjs/xterm.js Oct 7, 2019
@jerch
Copy link
Member

jerch commented Nov 23, 2019

Suggestion:

  • place a clear note in the docs, that a working local echo is not easy to set up due to xterm.js being built with a pty in mind
  • refer to https://github.com/wavesoft/local-echo for an elaborated example how to overcome this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests