fff
fff copied to clipboard
use the mimetype command instead of the file command
https://unix.stackexchange.com/questions/185216/file-command-apparently-returning-wrong-mime-type
I think keeping this as file is fine as the "errors" occur on plain-text files which are then opened in the text editor regardless of type. Care to elaborate on why you believe this change is needed?
i have a typescript file, but file command return wrong type as following.
curl -sSL https://raw.githubusercontent.com/howdy39/gas-clasp-starter/master/src/sheet.service.ts | file -biL -
application/x-sc; charset=us-ascii
sure, file command and if error, xdg-open should keep simple as you said.
but i do not understand why nohup and disown it instead of use xdg-open directly. I am using fff from remote and nothing will happen if file command return error. why not
clear_screen
reset_terminal
"${VISUAL:-${EDITOR:-xdg-open}}" "$1"
setup_terminal
redraw
# 'nohup': Make the process immune to hangups.
# '&': Send it to the background.
# 'disown': Detach it from the shell.
#nohup "${FFF_OPENER:-${opener:-xdg-open}}" "$1" &>/dev/null &
#disown