Giter Club home page Giter Club logo

Comments (4)

stevesims avatar stevesims commented on August 16, 2024 1

whilst this might not be what you are expecting, this is working as intended/designed.

pressing "up" when you are not at the beginning of an input line is intended to take you either up a line (when the input line wraps over multiple lines) or to the beginning of the top line.
pressing "up" at the beginning of an input line will attempt to fetch the previous history entry. if this is successful your input cursor will be placed at the end of the line

the "down" arrow works "fine" because you're left at the end of the input line. if your cursor however has been moved somewhere other than the end of the input line, then your first "down" press will bring you to the end of the line

I do understand that the up key handing isn't what you expected, but I couldn't work out a sensible way to get it to work in the kind of manner you were suggesting and still have sensible multi-line editing working. leaving the cursor at the beginning of the line when stepping thru history would "solve" this issue, but also feel weird in use when you want to edit a previously used command. other possibilities involve complex algorithms that change the line editing behaviour depending on whether the user has tried to edit the line or not, and can also end up feeling "unnatural".

at some point I plan to add support for page up/down keys to move thru command history, which would not care about cursor position on the line

from agon-mos.

tonedef71 avatar tonedef71 commented on August 16, 2024

leaving the cursor at the beginning of the line when stepping thru history would "solve" this issue, but also feel weird in use when you want to edit a previously used command

Being able to continuously scroll up and down with the up & down keys through the command history unimpeded is preferable. If the "home" & "end" keys are working properly, perhaps they could be used to opt-in and/or opt-out of "command history mode" based on the current context (the cursor's current position, whether it be at the beginning, end, or middle of a line; the current keyboard mode, whether it be "command history mode" or "editing mode"; etc.).

As you mentioned, though, I'm not sure how complex the algorithms would be to implement, or whether or not folks would find using the "home" and "end" keys to influence the keyboard mode behavior to feel too unnatural. I can understand why you want to transfer the command history control keys from the up & down keys to the page up & page down keys.

from agon-mos.

leventp avatar leventp commented on August 16, 2024

Hi Steve, thanks for explaining the logic behind the design. All is well. Looking forward to '*KEY' implementation;)

from agon-mos.

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.