I missed a day yesterday because of holiday travel issues, but I’m prepared to make amends with fselect.
I mentioned Peter Penchev’s original fselect in the past, but only in the context that it failed to build for me, and therefore fell into a category of software casualties. I suppose we have Theodore to thank for making it functional again. 😉
In that sense I can only look over what Theodore built, so it may be that the style and execution are part of the original, and not necessarily what Theodore worked to fix. 😉
As you can see, fselect allows you to select a file out of a list, and will return that to STDOUT as the results of its interaction. For what I could see, fselect only accepted file names in the same fashion as you might get from
ls; in other words, I couldn’t cat a list of words to fselect and pick from them, like you might see in slmenu, sentaku, fzf or other file/text selectors.
fselect has some internal controls that you will want to know before you use it. Pressing Enter or Esc exits the program, but if you haven’t selected a file (or more) with the spacebar, you’ll get nothing from STDOUT.
If you’re just after one particular file, the dot key is a one-button combination of space-and-Enter, and sends your selection onward. That’s how something like
vim $(fselect textfiles/*) is possible, as a quick-and-clean file selector.
fselect itself takes a few flags, perhaps most interesting being the
-y command, which steps through the list of files one by one, and asks if you wish to select it. If you’re in a severely restricted environment or need to think hard on each choice, this may be a useful option to you.
I should note that it’s also possible to select directories with fselect, but I don’t believe there’s a provision for moving through directories. Please correct me if I’m wrong on that.
Just about the only suggestions I would offer would be color (which Theodore mentioned as a future development) and perhaps the option to use narrower file listings, rather than a full width listing in the manner of
ls -lha. In an 80×24 terminal, depending on the width of the preliminary data, it was possible to cut off the file names from the right side of the display, making it difficult to see what you’re picking.
fselect is not in Debian or Arch that I could find, meaning if you want to tinker with either the original or resurrected form, you’ll probably have to build it from source. Be the first kid on your block to try it out. Tell people how you used fselect before it was popular. You’re so hip. 😉
Pingback: iselect: A program’s got to know its limitations | Inconsolation
Pingback: iselect: A program’s got to know its limitations | Linux Admins