Suppose I want to look through a list of files and interactively open it through the terminal, I've been using
locate filename | head -n 1 | xargs xdg-open
or some such thing. The other option is to click on the filename that shows up using the mouse and then paste it.
Tmux let's me navigate my terminal, copy lines and incorporate them into commands. Is there a way to do this in bash or zsh, or perhaps directly in the terminal emulator?