I’m talking about programs that can’t be improved no matter what. They do exactly what they’re supposed to and will never be changed.

It’ll probably have to be something small, like cd or pwd, but does such a program exist?

  • Kissaki@programming.dev
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 day ago

    For software to be perfect, can not be improved no matter what, you’d have to define a very specific and narrow scope and evaluate against that.

    Environments change, text and data encoding and content changes, forms and protocol of input and output changes, opportunities and wishes to integrate or extend change.

    pwd seems simple enough. cd I would already say no, with opportunities to remember folders, support globbing, fuzzy matching, history, virtual filesystems. Many of those depend on the environment you’re in. Typically, shells handle globbing. There’s alternative cd tools that do fuzzy matching and history, and virtual filesystems are usually abstracted away. But things change. And I would certainly like an interactive and fuzzy cd.

    Now, if you define it’s scope, you can say: “All that other stuff is out of scope. It’s perfect within it’s defined target scope.” But I don’t know if that’s what you’re looking for? It certainly doesn’t mean it can’t be improved no matter what.

    • ne0phyte@feddit.org
      link
      fedilink
      arrow-up
      1
      ·
      1 day ago

      If you just need the functionality then fzf does (among other things) exactly that. Interactive fuzzy cd. If you use the shell bindings you can do cd foo/bar/**<tab> to get a recursive fuzzy matching or you can do alt+c to immediately find any subdirectory and directly cd into it upon pressing enter. You can also use Ctrl+T to find and insert a path into the prompt.

      • Kissaki@programming.dev
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        9 hours ago

        Thanks for the suggestion. As a first step, I set it up in Nushell with a ctrl+t shortcut:

        $env.config.keybindings = (
            $env.config.keybindings | append {
                name: fzf_file_picker
                modifier: control
                keycode: char_t
                mode: [emacs, vi_insert, vi_normal]
                event: {
                    send: ExecuteHostCommand
                    cmd: "commandline edit --insert (fzf | str trim)"
                }
            }
        )
        

        Maybe I will look into more. :) I’ve known about fzf but I guess never gotten around to fully evaluating and integrating it.

        Nushell supports fuzzy completions, globbing, and “menus” (TUI) natively. Still, the TUI aspect and possibly other forms of integrations seem like they could be worthwhile or useful as extensions.