Giter VIP home page Giter VIP logo

Comments (15)

maxlandon avatar maxlandon commented on May 30, 2024 1

Hello Sammy,
Yes there are a few things I didn't take care of in the prompt code (among which are all emojis and fonts that can't be stripped as easily as colored strings.)
Stay in touch, I will solve that soon, along with many other changes and enhancements.
All of this will land towards the end of December.
As well, watching your profile: you might be interested by github.com/lmorg/murex (the latter uses a readline lib from which I forked mine and enhanced it). Pointing this to you not for readline code, but for the entire shell itself: the maintainer has spent much time writing it.
I'll ping here as soon as problems are solved.

from readline.

maxlandon avatar maxlandon commented on May 30, 2024 1

Back to this:

  • History search: This is probably because by default, history search commands (when using completions) recompute regexp matching subgroups highlighting.
    This has not changed with the last version, so it should not be faster. I'll try to find a way to speed this up, so that this lag disappears.

  • Lock ups/empty line: This should be solved. The library has been entirely rewritten, including key dispatch and various related stuff. Previously, there were some
    lacks in the underlying line/visual selection logic, and on top of a deficient dispatch, this would make things worse. Should be solved now.

from readline.

TorchedSammy avatar TorchedSammy commented on May 30, 2024

hi, any updates?

from readline.

maxlandon avatar maxlandon commented on May 30, 2024

Hello Sammy, sorry for having ghosted the repo for months, I was away. So as you noticed I got back to it a few weeks ago.

The library has been completely redesigned, with a new keymap model, many new features and enhancements, and a somewhat reduced/cleaned API. So it is going to be slightly different from the one you're currently using, especially as far as completion/history/hints are declared and populated.
I hope that the new version will help you in your shell.

Related to your proposal:

  • Fish-like autosuggestions have been implemented in the new version. Probably no need for this.
  • I'm still in want of implementing a decent multiline editing support, in case someone other than you would want to use this readline for a shell. So there are a couple of things to consider here. First, I opened a specific issue (#4) to describe what should be done and where someone should look for correct and clean logic.
    Don't get me wrong, it's not trivial to implement, so I'm just saying this in case you want to knock yourself off at it ! Anyway, and if yes, I suggest to go over the codebase first, starting by readline.go.
  • I saw you added some emacs stuff to your fork: as well, you'll see that the new version integrates all of those... and more !

Available if you have questions or suggestions !
Hilbish looks cool by the way !

from readline.

TorchedSammy avatar TorchedSammy commented on May 30, 2024

Available if you have questions or suggestions

Since I've finally decided to start an attempt at using this in Hilbish, I have a few things to ask and say. A little note that this is from me just importing the new library and making minimal working changes. Thanks for all the hard work!

Questions

  • How do I set the prompt from the Go API?
  • What happened to the display types for the completions?
  • Why are my completions appearing on key input, it should only appear on tab.
  • Why is there a config for this now? I feel like this functionality could be done in some separate package, also helps me avoid the extra YAML dependency. The config is of course not going to be good use for me because Hilbish is configured via Lua.

Feedback

I think the reduced API is more of a downgrade than a good thing, but the new features as I've seen from the README are good additions that I would like to add to Hilbish.

Issues

  • Discovered that sometimes if I hit enter it results in a ^J in the input.
  • Sometimes on input the cursor is more to the right than it is supposed to be (Extra spacing for some reason).
  • There are various types that are supposed to be public but are not (#21, config)
  • I tried hitting Ctrl-R to bring up my history and it seemed to freeze up. I'm not even sure if my history is working. I tried doing any keybind that would be expected to work (up arrow for history, Ctrl-R) and it froze up?

Hilbish looks cool by the way

thanks :D

from readline.

maxlandon avatar maxlandon commented on May 30, 2024

Prompts: check https://github.com/reeflective/readline/wiki/Prompts

Display types: Disappeared. The completion API has radically changed.

Autocomplete: because the configuration enables as-you-type autocomplete by default. I should probably set it off though.

Config: there is a configuration so that anyone can use its own bindings when the tool they are using is using readline. check https://github.com/reeflective/readline/wiki/Configuration-File
Down the road the package might be refactored, but that is not planned for now.

Issues

  • Enter: will check that. Should not happen.
  • Cursor: weird, it is supposed to correctly count prompt runes. I will check that also.

from readline.

TorchedSammy avatar TorchedSammy commented on May 30, 2024

Prompts: check https://github.com/reeflective/readline/wiki/Prompts

the prompt type here is not public (edit: i just made it on a fork)

i think it would be good to be able to set the available config values via the go api, and also adding custom widgets?

from readline.

TorchedSammy avatar TorchedSammy commented on May 30, 2024

I tried doing any keybind that would be expected to work (up arrow for history, Ctrl-R) and it froze up?

any suggestions for this either

from readline.

maxlandon avatar maxlandon commented on May 30, 2024

Prompts: check https://github.com/reeflective/readline/wiki/Prompts

the prompt type here is not public (edit: i just made it on a fork)

i think it would be good to be able to set the available config values via the go api, and also adding custom widgets?

Prompt:

var shell = *readline.Instance
shell.Prompt.Primary()
...

Config:

var shell = *readline.Instance
shell.Config.Vim.Cursor = ""

Existing widgets:

var shell = *readline.Instance
shell.Config.Keymaps["viins"]["^B" = "backward-word"

Custom callbacks:
https://github.com/reeflective/readline/wiki/Custom-Callbacks

from readline.

maxlandon avatar maxlandon commented on May 30, 2024

I tried doing any keybind that would be expected to work (up arrow for history, Ctrl-R) and it froze up?

any suggestions for this either

Could you give me a snippet of your code for this ? Thanks.

from readline.

TorchedSammy avatar TorchedSammy commented on May 30, 2024

i have my code in hilbish via the pr here Rosettea/Hilbish#228

from readline.

TorchedSammy avatar TorchedSammy commented on May 30, 2024

ok so turns out the keybinds changed which i didnt look at, im definitely gonna set it back on hilbish because esc-everthing is what i hate on emacs.

so now that i looked at them, i have noticed that history search is very slow, it is noticeably a lot slower than the old version. and there is still the previously mentioned lock ups which seem t be because the line is empty when trying to use a bind?

from readline.

maxlandon avatar maxlandon commented on May 30, 2024

Emacs escape: note that the escape notation is equivalent to the Alt key modifier.
So given an "Esc-A" key combo, it is equivalent to "Alt-A".
The difference is that if you use ESC, you use it sequentially with A, while Alt must be pressed together with A.

History search: no reason why it would be slower. The pattern matching logic did not change. Or... you have millions of lines ? Not sure what to think/say here.

Lock ups/empty line: Can you reformulate ? I don't understand what you mean here.

from readline.

TorchedSammy avatar TorchedSammy commented on May 30, 2024

History search: no reason why it would be slower. The pattern matching logic did not change. Or... you have millions of lines ? Not sure what to think/say here.

i have 40k lines of history

Lock ups/empty line: Can you reformulate ? I don't understand what you mean here

if i have an empty line and try to use certain keybinds (like history backward search) it seems like the library goes into some infinite loop? or something else causes it to not accept more input

from readline.

maxlandon avatar maxlandon commented on May 30, 2024

Solved lagging history search. The logic has been enhanced and does not fetch/processes more lines than what the terminal can show. All history search submodes work perfect now.
Thanks for pointing this out !

from readline.

Related Issues (17)

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.