I have the following fish function, that passes a list of words to fzf
and once I select one, it removes the line break from the end and send it to the clipboard.
function spell_checker
fzf < /usr/share/dict/words | tr -d '\n' | xclip -selection clipboard
end
The functions works well when I call it directly, but what I want to do is to create a shortcut for it. I am using $TERM -e fish -c spell_checker
, to open a terminal, run the program and then immediately close the terminal, but for some reason when I call the command it does not work as expected. It opens the terminal, shows me the fzf with the list of words, but it does not send it to the clipboard.
Any input on what could be causing this behaviour?
I tried a simple version of the function that simply sends something to the clipboard and it doesn't seem to work either. I tried with the terminals st, alacritty and xterm but they all behave the same.