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

From: the_wurfkreuz <[email-masked]>
Date: Mon, 17 Mar 2025 10:42:28 +0000

I did this:

```
(defun my-sh--guess-shell ()
  "/bin/bash")
(advice-add 'sh--guess-shell :override #'my-sh--guess-shell)
```

Looks like it does what i want in my case.

On Monday, March 17th, 2025 at 6:49 AM, Yuan Fu <[email-masked]> wrote:

> > 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