Comments (10)
Indeed, it seems possible to move only the cursor like here or here.
I will try on unix.
from rustyline.
Ok,
Moving only the cursor may be difficult in multi-line mode.
I am not sure but it seems to me that the culprit is the current strategy used to refresh the screen.
Because we are clearing from the prompt to the end of the screen (\x1b[J
).
Could you please confirm that if we clear only the lines/rows drawn/used by the editor, your issue will be solved ?
from rustyline.
@gwenn yes, I think that is the right strategy. Even better might be to take a rectangle or bounding box as a parameter. I also don't think that the prompt should write anything to output. This can be done by application code and separates concerns.
from rustyline.
What I mean about writing to stdout is to not write the prefix or the line ending. That gives a lot more flexibility to the code consuming the library. For example if I want to have "\r\n" rather "\n" as the EOL.
from rustyline.
Just so I fully understand, you want the following line to be removed:
https://github.com/kkawakam/rustyline/blob/master/src/lib.rs#L877
println!("");
?
from rustyline.
@gwenn yes, I think that line should either be removed, or the readline function should at least take an argument to allow for cross platform line endings. Thank you for your help.
from rustyline.
Are you sure println!("")
doesn't print \r\n
on windows ?
from rustyline.
Are you sure println!("") doesn't print \r\n on windows ?
No.
I am more concerned with how it inter-operates with termion. I am going to open source the project I am using rustyline in, so I can give a link after I update the license. Also, I can open a new ticket to discuss line terminators if it makes sense to.
from rustyline.
The associated patch has been merged in master.
from rustyline.
Thanks!
from rustyline.
Related Issues (20)
- Test binding::test::size_of_event fails on i686 / 32 bits arches HOT 4
- diy_hints example code doesn't work HOT 3
- kitty keyboard protocol HOT 1
- CompletionType::List does not support completion candidates that are shorter than the input HOT 5
- readline overrides stdout buffer HOT 1
- [tty/unix] Do not disable termios signals HOT 6
- Custom error in history api HOT 4
- how can I flush the stdout when i use print macro? HOT 4
- Line highlighting does not begin until backspace is pressed HOT 4
- sqlite_history fts5 version
- doc question HOT 1
- Logging visible when using `env_logger` HOT 1
- A single line is too long, causing it to print on the next line HOT 2
- replace clipboard-win by copypasta HOT 1
- Abort readline? HOT 3
- Feature request: Julia-style "next command" down key in the REPL HOT 2
- How to handle partial of the input? HOT 2
- Dead link in README HOT 2
- Handle Ctrl-C differently depending on content HOT 1
- Implement Write for external printer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rustyline.