Skip to content

Implement equivalent to ZSH's zle accept-line for better integration with atuin #11065

Closed

Description

@gergelyk

Related problem

atuinsh/atuin#1392 (comment)

Describe the solution you'd like

Allow for sending a command to the commandline and executing it immediately.

Describe alternatives you've considered

No response

Additional context and details

No response

Activity

  1. added
    category:enhancement
    status:needs-triage
    on Nov 15, 2023
  2. fdncred commented on Nov 15, 2023

    @fdncred
    Contributor

    Seems like someone could add commandline --accept or some such thing. There's also options to look at reedline's send events to see if you can send an enter after a commandline update.

  3. arcuru commented on Nov 15, 2023

    @arcuru

    As one additional detail, for atuin it would need to be usable from within a keybinding. I know that sometimes keybindings have their own quirks so I'm just calling that out in case it applies here in Nushell.

  4. sholderbach commented on Nov 15, 2023

    @sholderbach
    Member

    Does the event: executehostcommand fit the bill for that? This would not add to the internal history but allow execution based on a keybinding?

  5. fdncred commented on Nov 15, 2023

    @fdncred
    Contributor

    @sholderbach from what i've looked at, executehostcommand will run things like fzf and put the output on the command line but not execute the returned results. Maybe I'm mistaken, but I thought the OP was looking for a way to execute the item that gets put on the command line buffer.

  6. ellie commented on Nov 16, 2023

    @ellie

    I thought the OP was looking for a way to execute the item that gets put on the command line buffer.

    That's correct - we'd need a way for the keybinding to immediately execute the result in the buffer

    This would be the same (functionally) as zle accept-line for zsh

  7. fdncred commented on Nov 16, 2023

    @fdncred
    Contributor

    I think this is going to have to be a change in reedline. This is what I've tried without success.

    Creating keybindings with these events after commandline has run.

    1. submit event
    2. submitornewline event
    3. enter event
    4. pipeline with (char -i 13) in it

    There's something that's preventing anything from running after commandline. I'd also add that I don't really like how commandline runs as it creates a new command line and doesn't update the existing one. That should be fixed too.

    Ugh, I also found another bug in commandline where it only correctly uses --cursor-end the first time.

  8. mrdgo commented on Aug 29, 2024

    @mrdgo
    Contributor

    I think this is going to have to be a change in reedline. This is what I've tried without success.

    Creating keybindings with these events after commandline has run.

    1. submit event
    
    2. submitornewline event
    
    3. enter event
    
    4. pipeline with (char -i 13) in it
    

    There's something that's preventing anything from running after commandline. I'd also add that I don't really like how commandline runs as it creates a new command line and doesn't update the existing one. That should be fixed too.

    Ugh, I also found another bug in commandline where it only correctly uses --cursor-end the first time.

    that certain something was that event::read()? that blocks without checking the event queue. In my PR I added a check, if the event queue is not empty before blocking.

  9. sholderbach commented on Aug 17, 2025

    @sholderbach
    Member

    Closed by #16193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:enhancementstatus:needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions