Subject: Re: bug#77025: 31.0.50; Can't activate bash-ts-mode without a shebang

From: Yuan Fu <[email-masked]>
Date: Sun, 16 Mar 2025 23:49:44 -0700

> On Mar 15, 2025, at 5:40 AM, Eli Zaretskii <[email-masked]> wrote:
> 
>> Date: Sat, 15 Mar 2025 12:02:38 +0000
>> From: the_wurfkreuz <[email-masked]>
>> Cc: [email-masked]
>> 
>> I've tried to build with the latest commit, the end result is the same. I also tried to install the latest stable version of emacs (30.1) using nix. Same thing.
>> 
>> I attached a video snippet.
> 
> There's no need for video clips, I believe you.  I just cannot
> reproduce this.
> 
> Could this be due to some outdated or newer grammar library?
> 
> Or maybe this is specific to GNU/Linux for some reason?
> 
> Can someone please try reproducing this and debugging it?  Yuan?

I guess that’s because your default shell is bash. On my machine, my default shell is fish, so it falls back to sh-mode too. When bash-ts-mode is enabled, it does an extra check to see if the file is actually bash, if it can’t be sure, it falls back to sh-mode. See sh--redirect-bash-ts-mode. 

If you enable bash-ts-mode in a file that ends with “.sh”, it should stay in bash-ts-mode.

Yuan