strtok / xterm-readline Goto Github PK
View Code? Open in Web Editor NEWa library for building command-line interfaces with XtermJS
License: MIT License
a library for building command-line interfaces with XtermJS
License: MIT License
Reproduction:
This appears to be an issue with Readline.write()'s \n regex. It's not prepending \r to text the begins with \n.
First off, thanks for creating this package.
I'm using it create a REPL using Pyodide (Python compiled to wasm), and I would like to add support for tab completions. The idea is that when you press tab, it does one of the following (which is similar to the normal python
REPL):
I don't see a good way to do this with the existing API. One way to go would be to provide a way register a completion handler; this handler would be a function which takes a string (the text typed on the command line so far) and returns an array of strings (the list of possible completions).
So the usage would be something like this:
readline.setCompletionHandler((text: string): string[] => {
// Do stuff here
})
I am having hard time make readline working properly in vi/vim mode and letters are jumping and adding bunch of letters on top the current when try to navigate or even try to type anything. Any guidance on how to initialize Vi/vim properly and handle all keyboard events?
Thank you.
I am basically forwarding this (wrongly opened) Xterm.js issue: xtermjs/xterm.js#4966
Apparently when no argument/parameter is passed to input()
, or input("")
with empty string, expectations are broken and the terminal prints last printed thing twice.
Is this a known issue and/or can we fix it by passing a zero-width char out of the box, when no argument is provided, which solves all the things?
That is: input("")
(note: you don't see it, that's its purpose, your IDE would though, or should!)
input("")
GitHub copy would definitively give you that invisible char!
Thank you!
There's a few ways to see symptoms of this:
This is tracked in the rustyline project by kkawakam/rustyline#611
Currently, if you call write()
after you read()
and before that read has completed, the written text is inserted directly after the prompt with the typed content and the prompt line is not refreshed. If you backspace to force it to refresh, it overwrites the written text as if the write()
has never happened.
This would be useful for an async REPL where text may be printed from async code running in the background.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.