Giter Club home page Giter Club logo

Comments (10)

gwenn avatar gwenn commented on August 29, 2024

Indeed, it seems possible to move only the cursor like here or here.
I will try on unix.

from rustyline.

gwenn avatar gwenn commented on August 29, 2024

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.

dcampbell24 avatar dcampbell24 commented on August 29, 2024

@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.

dcampbell24 avatar dcampbell24 commented on August 29, 2024

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.

gwenn avatar gwenn commented on August 29, 2024

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.

dcampbell24 avatar dcampbell24 commented on August 29, 2024

@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.

gwenn avatar gwenn commented on August 29, 2024

Are you sure println!("") doesn't print \r\n on windows ?

from rustyline.

dcampbell24 avatar dcampbell24 commented on August 29, 2024

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.

gwenn avatar gwenn commented on August 29, 2024

The associated patch has been merged in master.

from rustyline.

dcampbell24 avatar dcampbell24 commented on August 29, 2024

Thanks!

from rustyline.

Related Issues (20)

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.