fff icon indicating copy to clipboard operation
fff copied to clipboard

use the mimetype command instead of the file command

Open wukuan405 opened this issue 6 years ago • 4 comments

https://unix.stackexchange.com/questions/185216/file-command-apparently-returning-wrong-mime-type

wukuan405 avatar Oct 20 '19 13:10 wukuan405

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?

dylanaraps avatar Oct 20 '19 14:10 dylanaraps

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

wukuan405 avatar Oct 20 '19 23:10 wukuan405

sure, file command and if error, xdg-open should keep simple as you said.

wukuan405 avatar Oct 21 '19 00:10 wukuan405

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

wukuan405 avatar Oct 21 '19 00:10 wukuan405