[PATCH] Remove shebang from fish completion

Johannes Altmanninger aclopte at gmail.com
Mon Jun 14 22:18:02 UTC 2021


On Mon, Jun 14, 2021 at 11:03:48PM +0200, Dan Čermák wrote:
> Afaik fish shell completions don't need a shebang
> (plus the script is not executable anyway)

Yeah, that is the convention - I didn't make this change because it breaks
syntax highlighting in my editor.
This is because my editor recognizes fish filetypes based on
1. file extension (".fish")
   - but "pass.fish-completion" does not follow that convention
2. output of "file --mime"
   - without the shebang, file(1) no longer recognizes that this is a shell script.

Replacing the shebang with a modeline like "# vim: ft=fish" would fix detection
for me. Not sure if that is more future-proof than the shebang - looks like
VSCode can parse emacs modelines but not Vim ones.

Note that most editors (including Vim) don't include fish support by default.

> 
> 
> ---
>  src/completion/pass.fish-completion | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/src/completion/pass.fish-completion b/src/completion/pass.fish-completion
> index 38a4865..0f57dd2 100644
> --- a/src/completion/pass.fish-completion
> +++ b/src/completion/pass.fish-completion
> @@ -1,5 +1,3 @@
> -#!/usr/bin/env fish
> -
>  # Copyright (C) 2012-2014 Dmitry Medvinsky <me at dmedvinsky.name>. All Rights Reserved.
>  # This file is licensed under the GPLv2+. Please see COPYING for more information.
>  


More information about the Password-Store mailing list