Coder Social home page Coder Social logo

Bind entry deletion about mcfly-fzf HOT 3 OPEN

ramnes avatar ramnes commented on July 25, 2024
Bind entry deletion

from mcfly-fzf.

Comments (3)

bnprks avatar bnprks commented on July 25, 2024

I think the main challenge with deletion in the fzf interface is handling confirmations well, so that users get a confirmation prompt before permanently deleting a history entry. Though looking at the fzf docs I think that the execute action may be able to handle confirmation.

In that case, the elements would be

  1. Find/make a CLI one-liner that can delete a history entry with command-line confirmation (e.g. y/n prompt). This would likely require writing a little rust code and adding a new subcommand to mcfly-fzf, and reading the mcfly code to find what function to call to perform a deletion
  2. Add a key-binding to the fzf setup scripts that will call that command appropriately

For prototyping, I'd recommend you start with 2 and make a dummy python script or something to make sure that the UI of prompt + confirm will work well, and ensure that you are able to get the relevant information passed to the CLI script.

Definitely something I'd be happy to take a pull request on if you can get it working

from mcfly-fzf.

ramnes avatar ramnes commented on July 25, 2024

FWIW I don't like McFly's confirmation in the first place. What do you think of skipping the confirmation in a first iteration, disabling the shortcut by default and adding an environment variable flag, e.g. MCFLY_FZF_UNSAFE_DELETE=1? Then we could see to eventually add the confirmation and make it activated by default.

from mcfly-fzf.

bnprks avatar bnprks commented on July 25, 2024

Yeah, disabled by default but no confirmation sounds good to me. I'll take a look at your pull over the next few days as I have time. I'm also a bit of a rust noob, but I've found tinkering on projects like mcfly and reedline to be a good learning experience

from mcfly-fzf.

Related Issues (6)

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.