GNU bug report logs - #77025
31.0.50; Can't activate bash-ts-mode without a shebang

Previous Next

Package: emacs;

Reported by: the_wurfkreuz <the_wurfkreuz <at> proton.me>

Date: Sat, 15 Mar 2025 06:42:02 UTC

Severity: normal

Found in version 31.0.50

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 77025 in the body.
You can then email your comments to 77025 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#77025; Package emacs. (Sat, 15 Mar 2025 06:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to the_wurfkreuz <the_wurfkreuz <at> proton.me>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 15 Mar 2025 06:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: the_wurfkreuz <the_wurfkreuz <at> proton.me>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 31.0.50; Can't activate bash-ts-mode without a shebang
Date: Sat, 15 Mar 2025 06:41:10 +0000
[Message part 1 (text/plain, inline)]
If i try to activate bash-ts-mode in a file without a shebang, it
falls back to using shell-mode with zsh indentation.

Steps to reproduce:

1. emacs -Q
2. Clear out the scratch buffer from any text and paste this code into
the scratch buffer:

add_service() {
ln -s "$service_path" /var/service/
echo "Service is added:"
service_name=$(basename "$service_path")
ls -la /var/service/ | grep "$service_name"
}

3. If bash treesitter grammar isn't available, i usually install it
through the `treesit-install-language-grammar` command with all the
default options.
4. M-x bash-ts-mode

It returns this message "Indentation setup for shell type zsh", and
instead of using bash-ts-mode it uses sh-mode.

Now, if you add a shebang above like '#!/bin/sh' and try to activate
bash-ts-mode again, emacs will activate it.

The problem here is that this is probably the reason why i can't use
bash-ts-mode with org-babel, it always falls back to sh-mode when i
define a code block with bash-ts-mode.

In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.43, cairo version 1.18.0) of 2025-03-10 built on ub-void
Repository revision: b568ff418ce7147c27d7f82fe4a8eef325b9de2c
Repository branch: HEAD
System Description: Void Linux

Configured using:
'configure --with-native-compilation=aot --with-tree-sitter --with-gif
--with-png --with-jpeg --with-rsvg --with-tiff --with-imagemagick
--with-pgtk --with-mailutils'

Configured features:
CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ IMAGEMAGICK JPEG
LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG
SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP
XIM GTK3 ZLIB

Important settings:
value of $LC_COLLATE: C
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
savehist-mode: t
meow-global-mode: t
meow-mode: t
meow-normal-mode: t
meow-esc-mode: t
envrc-global-mode: t
envrc-mode: t
buffer-terminator-mode: t
global-git-commit-mode: t
magit-auto-revert-mode: t
marginalia-mode: t
vertico-mode: t
corfu-popupinfo-mode: t
corfu-history-mode: t
corfu-echo-mode: t
global-corfu-mode: t
corfu-mode: t
which-key-mode: t
undo-fu-session-global-mode: t
undo-fu-session-mode: t
global-treesit-auto-mode: t
global-auto-revert-mode: t
save-place-mode: t
electric-pair-mode: t
recentf-mode: t
global-display-line-numbers-mode: t
display-line-numbers-mode: t
override-global-mode: t
tooltip-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
minibuffer-regexp-mode: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t

Load-path shadows:
/home/wurfkreuz/.emacs.d/elpa/transient-20250306.1916/transient hides /usr/local/share/emacs/31.0.50/lisp/transient
~/.source/org-mode/lisp/ob-css hides /usr/local/share/emacs/31.0.50/lisp/org/ob-css
~/.source/org-mode/lisp/ob-ditaa hides /usr/local/share/emacs/31.0.50/lisp/org/ob-ditaa
~/.source/org-mode/lisp/org-fold-core hides /usr/local/share/emacs/31.0.50/lisp/org/org-fold-core
~/.source/org-mode/lisp/org-capture hides /usr/local/share/emacs/31.0.50/lisp/org/org-capture
~/.source/org-mode/lisp/org-colview hides /usr/local/share/emacs/31.0.50/lisp/org/org-colview
~/.source/org-mode/lisp/org-entities hides /usr/local/share/emacs/31.0.50/lisp/org/org-entities
~/.source/org-mode/lisp/ob-gnuplot hides /usr/local/share/emacs/31.0.50/lisp/org/ob-gnuplot
~/.source/org-mode/lisp/org-timer hides /usr/local/share/emacs/31.0.50/lisp/org/org-timer
~/.source/org-mode/lisp/ob-groovy hides /usr/local/share/emacs/31.0.50/lisp/org/ob-groovy
~/.source/org-mode/lisp/oc-basic hides /usr/local/share/emacs/31.0.50/lisp/org/oc-basic
~/.source/org-mode/lisp/ob-ref hides /usr/local/share/emacs/31.0.50/lisp/org/ob-ref
~/.source/org-mode/lisp/ob-scheme hides /usr/local/share/emacs/31.0.50/lisp/org/ob-scheme
~/.source/org-mode/lisp/ob-screen hides /usr/local/share/emacs/31.0.50/lisp/org/ob-screen
~/.source/org-mode/lisp/ob-core hides /usr/local/share/emacs/31.0.50/lisp/org/ob-core
~/.source/org-mode/lisp/org-protocol hides /usr/local/share/emacs/31.0.50/lisp/org/org-protocol
~/.source/org-mode/lisp/ob-sql hides /usr/local/share/emacs/31.0.50/lisp/org/ob-sql
~/.source/org-mode/lisp/ob-julia hides /usr/local/share/emacs/31.0.50/lisp/org/ob-julia
~/.source/org-mode/lisp/ob-lua hides /usr/local/share/emacs/31.0.50/lisp/org/ob-lua
~/.source/org-mode/lisp/org-clock hides /usr/local/share/emacs/31.0.50/lisp/org/org-clock
~/.source/org-mode/lisp/ob-tangle hides /usr/local/share/emacs/31.0.50/lisp/org/ob-tangle
~/.source/org-mode/lisp/ob-C hides /usr/local/share/emacs/31.0.50/lisp/org/ob-C
~/.source/org-mode/lisp/oc-natbib hides /usr/local/share/emacs/31.0.50/lisp/org/oc-natbib
~/.source/org-mode/lisp/ob-latex hides /usr/local/share/emacs/31.0.50/lisp/org/ob-latex
~/.source/org-mode/lisp/ob-forth hides /usr/local/share/emacs/31.0.50/lisp/org/ob-forth
~/.source/org-mode/lisp/oc-biblatex hides /usr/local/share/emacs/31.0.50/lisp/org/oc-biblatex
~/.source/org-mode/lisp/ob-js hides /usr/local/share/emacs/31.0.50/lisp/org/ob-js
~/.source/org-mode/lisp/org-list hides /usr/local/share/emacs/31.0.50/lisp/org/org-list
~/.source/org-mode/lisp/ox-koma-letter hides /usr/local/share/emacs/31.0.50/lisp/org/ox-koma-letter
~/.source/org-mode/lisp/ol-docview hides /usr/local/share/emacs/31.0.50/lisp/org/ol-docview
~/.source/org-mode/lisp/org-goto hides /usr/local/share/emacs/31.0.50/lisp/org/org-goto
~/.source/org-mode/lisp/ol-bbdb hides /usr/local/share/emacs/31.0.50/lisp/org/ol-bbdb
~/.source/org-mode/lisp/ox-org hides /usr/local/share/emacs/31.0.50/lisp/org/ox-org
~/.source/org-mode/lisp/ox-html hides /usr/local/share/emacs/31.0.50/lisp/org/ox-html
~/.source/org-mode/lisp/org-pcomplete hides /usr/local/share/emacs/31.0.50/lisp/org/org-pcomplete
~/.source/org-mode/lisp/ol-doi hides /usr/local/share/emacs/31.0.50/lisp/org/ol-doi
~/.source/org-mode/lisp/ob-lob hides /usr/local/share/emacs/31.0.50/lisp/org/ob-lob
~/.source/org-mode/lisp/org hides /usr/local/share/emacs/31.0.50/lisp/org/org
~/.source/org-mode/lisp/ol-mhe hides /usr/local/share/emacs/31.0.50/lisp/org/ol-mhe
~/.source/org-mode/lisp/org-keys hides /usr/local/share/emacs/31.0.50/lisp/org/org-keys
~/.source/org-mode/lisp/ob-fortran hides /usr/local/share/emacs/31.0.50/lisp/org/ob-fortran
~/.source/org-mode/lisp/org-faces hides /usr/local/share/emacs/31.0.50/lisp/org/org-faces
~/.source/org-mode/lisp/ol hides /usr/local/share/emacs/31.0.50/lisp/org/ol
~/.source/org-mode/lisp/ob-perl hides /usr/local/share/emacs/31.0.50/lisp/org/ob-perl
~/.source/org-mode/lisp/ob-eval hides /usr/local/share/emacs/31.0.50/lisp/org/ob-eval
~/.source/org-mode/lisp/ob hides /usr/local/share/emacs/31.0.50/lisp/org/ob
~/.source/org-mode/lisp/ob-ruby hides /usr/local/share/emacs/31.0.50/lisp/org/ob-ruby
~/.source/org-mode/lisp/ob-lisp hides /usr/local/share/emacs/31.0.50/lisp/org/ob-lisp
~/.source/org-mode/lisp/ob-dot hides /usr/local/share/emacs/31.0.50/lisp/org/ob-dot
~/.source/org-mode/lisp/ox-icalendar hides /usr/local/share/emacs/31.0.50/lisp/org/ox-icalendar
~/.source/org-mode/lisp/org-id hides /usr/local/share/emacs/31.0.50/lisp/org/org-id
~/.source/org-mode/lisp/org-attach-git hides /usr/local/share/emacs/31.0.50/lisp/org/org-attach-git
~/.source/org-mode/lisp/ox-beamer hides /usr/local/share/emacs/31.0.50/lisp/org/ox-beamer
~/.source/org-mode/lisp/org-num hides /usr/local/share/emacs/31.0.50/lisp/org/org-num
~/.source/org-mode/lisp/org-tempo hides /usr/local/share/emacs/31.0.50/lisp/org/org-tempo
~/.source/org-mode/lisp/oc hides /usr/local/share/emacs/31.0.50/lisp/org/oc
~/.source/org-mode/lisp/ob-sqlite hides /usr/local/share/emacs/31.0.50/lisp/org/ob-sqlite
~/.source/org-mode/lisp/ob-calc hides /usr/local/share/emacs/31.0.50/lisp/org/ob-calc
~/.source/org-mode/lisp/ob-exp hides /usr/local/share/emacs/31.0.50/lisp/org/ob-exp
~/.source/org-mode/lisp/ob-eshell hides /usr/local/share/emacs/31.0.50/lisp/org/ob-eshell
~/.source/org-mode/lisp/org-habit hides /usr/local/share/emacs/31.0.50/lisp/org/org-habit
~/.source/org-mode/lisp/ox-texinfo hides /usr/local/share/emacs/31.0.50/lisp/org/ox-texinfo
~/.source/org-mode/lisp/ol-eww hides /usr/local/share/emacs/31.0.50/lisp/org/ol-eww
~/.source/org-mode/lisp/org-feed hides /usr/local/share/emacs/31.0.50/lisp/org/org-feed
~/.source/org-mode/lisp/ox hides /usr/local/share/emacs/31.0.50/lisp/org/ox
~/.source/org-mode/lisp/org-inlinetask hides /usr/local/share/emacs/31.0.50/lisp/org/org-inlinetask
~/.source/org-mode/lisp/ol-eshell hides /usr/local/share/emacs/31.0.50/lisp/org/ol-eshell
~/.source/org-mode/lisp/ol-bibtex hides /usr/local/share/emacs/31.0.50/lisp/org/ol-bibtex
~/.source/org-mode/lisp/org-archive hides /usr/local/share/emacs/31.0.50/lisp/org/org-archive
~/.source/org-mode/lisp/ox-md hides /usr/local/share/emacs/31.0.50/lisp/org/ox-md
~/.source/org-mode/lisp/org-cycle hides /usr/local/share/emacs/31.0.50/lisp/org/org-cycle
~/.source/org-mode/lisp/ol-irc hides /usr/local/share/emacs/31.0.50/lisp/org/ol-irc
~/.source/org-mode/lisp/ob-clojure hides /usr/local/share/emacs/31.0.50/lisp/org/ob-clojure
~/.source/org-mode/lisp/org-lint hides /usr/local/share/emacs/31.0.50/lisp/org/org-lint
~/.source/org-mode/lisp/org-duration hides /usr/local/share/emacs/31.0.50/lisp/org/org-duration
~/.source/org-mode/lisp/org-refile hides /usr/local/share/emacs/31.0.50/lisp/org/org-refile
~/.source/org-mode/lisp/ob-matlab hides /usr/local/share/emacs/31.0.50/lisp/org/ob-matlab
~/.source/org-mode/lisp/org-table hides /usr/local/share/emacs/31.0.50/lisp/org/org-table
~/.source/org-mode/lisp/org-attach hides /usr/local/share/emacs/31.0.50/lisp/org/org-attach
~/.source/org-mode/lisp/org-element hides /usr/local/share/emacs/31.0.50/lisp/org/org-element
~/.source/org-mode/lisp/org-src hides /usr/local/share/emacs/31.0.50/lisp/org/org-src
~/.source/org-mode/lisp/org-version hides /usr/local/share/emacs/31.0.50/lisp/org/org-version
~/.source/org-mode/lisp/org-plot hides /usr/local/share/emacs/31.0.50/lisp/org/org-plot
~/.source/org-mode/lisp/ob-table hides /usr/local/share/emacs/31.0.50/lisp/org/ob-table
~/.source/org-mode/lisp/ob-octave hides /usr/local/share/emacs/31.0.50/lisp/org/ob-octave
~/.source/org-mode/lisp/org-mouse hides /usr/local/share/emacs/31.0.50/lisp/org/org-mouse
~/.source/org-mode/lisp/ob-sed hides /usr/local/share/emacs/31.0.50/lisp/org/ob-sed
~/.source/org-mode/lisp/org-ctags hides /usr/local/share/emacs/31.0.50/lisp/org/org-ctags
~/.source/org-mode/lisp/ob-plantuml hides /usr/local/share/emacs/31.0.50/lisp/org/ob-plantuml
~/.source/org-mode/lisp/ox-ascii hides /usr/local/share/emacs/31.0.50/lisp/org/ox-ascii
~/.source/org-mode/lisp/ob-makefile hides /usr/local/share/emacs/31.0.50/lisp/org/ob-makefile
~/.source/org-mode/lisp/ol-info hides /usr/local/share/emacs/31.0.50/lisp/org/ol-info
~/.source/org-mode/lisp/ob-processing hides /usr/local/share/emacs/31.0.50/lisp/org/ob-processing
~/.source/org-mode/lisp/ol-w3m hides /usr/local/share/emacs/31.0.50/lisp/org/ol-w3m
~/.source/org-mode/lisp/org-footnote hides /usr/local/share/emacs/31.0.50/lisp/org/org-footnote
~/.source/org-mode/lisp/ob-shell hides /usr/local/share/emacs/31.0.50/lisp/org/ob-shell
~/.source/org-mode/lisp/ol-man hides /usr/local/share/emacs/31.0.50/lisp/org/ol-man
~/.source/org-mode/lisp/ob-maxima hides /usr/local/share/emacs/31.0.50/lisp/org/ob-maxima
~/.source/org-mode/lisp/ob-org hides /usr/local/share/emacs/31.0.50/lisp/org/ob-org
~/.source/org-mode/lisp/ox-publish hides /usr/local/share/emacs/31.0.50/lisp/org/ox-publish
~/.source/org-mode/lisp/ob-R hides /usr/local/share/emacs/31.0.50/lisp/org/ob-R
~/.source/org-mode/lisp/org-datetree hides /usr/local/share/emacs/31.0.50/lisp/org/org-datetree
~/.source/org-mode/lisp/ob-comint hides /usr/local/share/emacs/31.0.50/lisp/org/ob-comint
~/.source/org-mode/lisp/ol-gnus hides /usr/local/share/emacs/31.0.50/lisp/org/ol-gnus
~/.source/org-mode/lisp/ob-awk hides /usr/local/share/emacs/31.0.50/lisp/org/ob-awk
~/.source/org-mode/lisp/org-compat hides /usr/local/share/emacs/31.0.50/lisp/org/org-compat
~/.source/org-mode/lisp/org-loaddefs hides /usr/local/share/emacs/31.0.50/lisp/org/org-loaddefs
~/.source/org-mode/lisp/org-element-ast hides /usr/local/share/emacs/31.0.50/lisp/org/org-element-ast
~/.source/org-mode/lisp/org-mobile hides /usr/local/share/emacs/31.0.50/lisp/org/org-mobile
~/.source/org-mode/lisp/ob-ocaml hides /usr/local/share/emacs/31.0.50/lisp/org/ob-ocaml
~/.source/org-mode/lisp/oc-csl hides /usr/local/share/emacs/31.0.50/lisp/org/oc-csl
~/.source/org-mode/lisp/ob-haskell hides /usr/local/share/emacs/31.0.50/lisp/org/ob-haskell
~/.source/org-mode/lisp/org-macro hides /usr/local/share/emacs/31.0.50/lisp/org/org-macro
~/.source/org-mode/lisp/ob-java hides /usr/local/share/emacs/31.0.50/lisp/org/ob-java
~/.source/org-mode/lisp/ob-python hides /usr/local/share/emacs/31.0.50/lisp/org/ob-python
~/.source/org-mode/lisp/org-fold hides /usr/local/share/emacs/31.0.50/lisp/org/org-fold
~/.source/org-mode/lisp/ox-man hides /usr/local/share/emacs/31.0.50/lisp/org/ox-man
~/.source/org-mode/lisp/ob-lilypond hides /usr/local/share/emacs/31.0.50/lisp/org/ob-lilypond
~/.source/org-mode/lisp/ox-latex hides /usr/local/share/emacs/31.0.50/lisp/org/ox-latex
~/.source/org-mode/lisp/org-agenda hides /usr/local/share/emacs/31.0.50/lisp/org/org-agenda
~/.source/org-mode/lisp/ol-rmail hides /usr/local/share/emacs/31.0.50/lisp/org/ol-rmail
~/.source/org-mode/lisp/org-indent hides /usr/local/share/emacs/31.0.50/lisp/org/org-indent
~/.source/org-mode/lisp/org-macs hides /usr/local/share/emacs/31.0.50/lisp/org/org-macs
~/.source/org-mode/lisp/oc-bibtex hides /usr/local/share/emacs/31.0.50/lisp/org/oc-bibtex
~/.source/org-mode/lisp/org-persist hides /usr/local/share/emacs/31.0.50/lisp/org/org-persist
~/.source/org-mode/lisp/ob-emacs-lisp hides /usr/local/share/emacs/31.0.50/lisp/org/ob-emacs-lisp
~/.source/org-mode/lisp/ob-sass hides /usr/local/share/emacs/31.0.50/lisp/org/ob-sass
~/.source/org-mode/lisp/org-crypt hides /usr/local/share/emacs/31.0.50/lisp/org/org-crypt
~/.source/org-mode/lisp/ox-odt hides /usr/local/share/emacs/31.0.50/lisp/org/ox-odt

Features:
(shadow sort mail-extr emacsbug help-fns radix-tree mule-util tramp-cmds
savehist f eshell em-tramp esh-cmd esh-ext esh-proc esh-opt esh-io
esh-arg esh-module esh-module-loaddefs esh-util meow meow-tutor
meow-cheatsheet meow-cheatsheet-layout meow-core meow-shims meow-esc
meow-command array meow-thing meow-visual meow-keypad meow-beacon
meow-helpers meow-util meow-keymap meow-face meow-var delsel org-tempo
tempo org-drill persist org-agenda embark-org org-element org-persist
org-id org-refile org-element-ast inline avl-tree org ob ob-tangle
ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete
org-list org-footnote org-faces org-entities ob-emacs-lisp ob-core
ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc
org-loaddefs cal-menu calendar cal-loaddefs org-version org-compat
org-macs eglot external-completion jsonrpc xref ert ewoc debug backtrace
kdl-mode generic markdown-mode color nix-mode nix-repl nix-shell
nix-store nix-log nix-instantiate nix-shebang nix-format nix yaml-mode
dockerfile-mode terraform-mode noutline outline hcl-mode lua-mode
perl-mode flymake envrc inheritenv buffer-terminator magit-bookmark
magit-submodule magit-blame magit-stash magit-reflog magit-bisect
magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff
git-commit log-edit message sendmail yank-media puny rfc822 mml mml-sec
epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums
mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log
magit-core magit-autorevert magit-margin magit-transient magit-process
magit-mode benchmark magit-git magit-base magit-section cursor-sensor
crm llama nerd-icons nerd-icons-faces nerd-icons-data
nerd-icons-data-mdicon nerd-icons-data-flicon nerd-icons-data-codicon
nerd-icons-data-devicon nerd-icons-data-sucicon nerd-icons-data-wicon
nerd-icons-data-faicon nerd-icons-data-powerline nerd-icons-data-octicon
nerd-icons-data-pomicon nerd-icons-data-ipsicon smerge-mode diff-mode
track-changes diff hydra lv with-editor server embark-consult embark
ffap thingatpt consult bookmark marginalia vertico project cape
corfu-popupinfo corfu-history corfu-echo corfu orderless wgrep grep
compile text-property-search which-key docker docker-context
docker-volume docker-network docker-image docker-container docker-faces
docker-core docker-compose docker-process docker-utils tablist advice
tablist-filter semantic/wisent/comp semantic/wisent
semantic/wisent/wisent semantic/util-modes semantic/util semantic
semantic/tag semantic/lex semantic/fw mode-local find-func cedet dired
dired-loaddefs tramp trampver tramp-integration files-x tramp-message
tramp-compat shell pcomplete comint ansi-osc ring parse-time iso8601
time-date ansi-color tramp-loaddefs docker-group transient format-spec
edmacro kmacro compat dash aio generator s goto-chg undo-fu-session
undo-fu zig-ts-mode clojure-ts-mode treesit-auto crontab-mode sh-script
smie treesit executable rose-pine-theme cus-edit pp cus-load midnight
autorevert filenotify saveplace desktop frameset elec-pair recentf
tree-widget wid-edit comp comp-cstr warnings comp-run comp-common rx
display-line-numbers cl-extra help-mode use-package use-package-ensure
use-package-delight use-package-diminish use-package-bind-key bind-key
easy-mmode use-package-core finder-inf buffer-terminator-autoloads
cape-autoloads clojure-ts-mode-autoloads corfu-autoloads
crontab-mode-autoloads docker-autoloads aio-autoloads
dockerfile-mode-autoloads embark-consult-autoloads consult-autoloads
embark-autoloads envrc-autoloads evil-collection-autoloads
annalist-autoloads evil-numbers-autoloads evil-surround-autoloads
evil-autoloads evil-textobj-tree-sitter-autoloads f-autoloads
goto-chg-autoloads hydra-autoloads inheritenv-autoloads
lua-mode-autoloads lv-autoloads magit-autoloads pcase
marginalia-autoloads markdown-mode-autoloads meow-autoloads
nerd-icons-autoloads nix-mode-autoloads magit-section-autoloads
llama-autoloads orderless-autoloads org-appear-autoloads
org-drill-autoloads persist-autoloads s-autoloads tablist-autoloads
tempel-collection-autoloads tempel-autoloads terraform-mode-autoloads
dash-autoloads hcl-mode-autoloads transient-autoloads
treesit-auto-autoloads undo-fu-autoloads undo-fu-session-autoloads
vertico-autoloads wgrep-autoloads info with-editor-autoloads
yaml-mode-autoloads zig-ts-mode-autoloads package browse-url xdg url
url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs icons password-cache json
subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib
rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win
term/common-win touch-screen pgtk-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo gtk pgtk
lcms2 multi-tty move-toolbar make-network-process tty-child-frames
native-compile emacs)

Memory information:
((conses 16 724959 72851) (symbols 48 43962 0) (strings 32 229590 6723)
(string-bytes 1 6733245) (vectors 16 74175) (vector-slots 8 885201 31589)
(floats 8 507 111) (intervals 56 1717 0) (buffers 992 11))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77025; Package emacs. (Sat, 15 Mar 2025 10:38:02 GMT) Full text and rfc822 format available.

Message #8 received at 77025 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: the_wurfkreuz <the_wurfkreuz <at> proton.me>
Cc: 77025 <at> debbugs.gnu.org
Subject: Re: bug#77025: 31.0.50; Can't activate bash-ts-mode without a shebang
Date: Sat, 15 Mar 2025 12:37:32 +0200
> Date: Sat, 15 Mar 2025 06:41:10 +0000
> From:  the_wurfkreuz via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> If i try to activate bash-ts-mode in a file without a shebang, it
> falls back to using shell-mode with zsh indentation.
> 
> Steps to reproduce:
> 
> 1. emacs -Q
> 2. Clear out the scratch buffer from any text and paste this code into
> the scratch buffer:
> 
> add_service() {
>     ln -s "$service_path" /var/service/
>     echo "Service is added:"
> service_name=$(basename "$service_path")
>     ls -la /var/service/ | grep "$service_name"
> }
> 
> 3. If bash treesitter grammar isn't available, i usually install it
> through the `treesit-install-language-grammar` command with all the
> default options.
> 4. M-x bash-ts-mode
> 
> It returns this message "Indentation setup for shell type zsh", and
> instead of using bash-ts-mode it uses sh-mode.

I cannot reproduce this with today's master branch.  Your build seems
to be from an old (Jan 20) checkout of the master branch, so please
try to sync from upstream and then see if the problem persists.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77025; Package emacs. (Sat, 15 Mar 2025 12:03:03 GMT) Full text and rfc822 format available.

Message #11 received at 77025 <at> debbugs.gnu.org (full text, mbox):

From: the_wurfkreuz <the_wurfkreuz <at> proton.me>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 77025 <at> debbugs.gnu.org
Subject: Re: bug#77025: 31.0.50; Can't activate bash-ts-mode without a shebang
Date: Sat, 15 Mar 2025 12:02:38 +0000
[Message part 1 (text/plain, inline)]
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.

On Saturday, March 15th, 2025 at 10:37 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > Date: Sat, 15 Mar 2025 06:41:10 +0000
> > From: the_wurfkreuz via "Bug reports for GNU Emacs,
> > the Swiss army knife of text editors" bug-gnu-emacs <at> gnu.org
> >
> > If i try to activate bash-ts-mode in a file without a shebang, it
> > falls back to using shell-mode with zsh indentation.
> >
> > Steps to reproduce:
> >
> > 1. emacs -Q
> > 2. Clear out the scratch buffer from any text and paste this code into
> > the scratch buffer:
> >
> > add_service() {
> > ln -s "$service_path" /var/service/
> > echo "Service is added:"
> > service_name=$(basename "$service_path")
> > ls -la /var/service/ | grep "$service_name"
> > }
> >
> > 3. If bash treesitter grammar isn't available, i usually install it
> > through the `treesit-install-language-grammar` command with all the
> > default options.
> > 4. M-x bash-ts-mode
> >
> > It returns this message "Indentation setup for shell type zsh", and
> > instead of using bash-ts-mode it uses sh-mode.
>
>
> I cannot reproduce this with today's master branch. Your build seems
> to be from an old (Jan 20) checkout of the master branch, so please
> try to sync from upstream and then see if the problem persists.
[2025-03-15 14-56-16.mkv (video/x-matroska, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77025; Package emacs. (Sat, 15 Mar 2025 12:41:02 GMT) Full text and rfc822 format available.

Message #14 received at 77025 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: the_wurfkreuz <the_wurfkreuz <at> proton.me>,
 Yuan Fu <casouri <at> gmail.com>
Cc: 77025 <at> debbugs.gnu.org
Subject: Re: bug#77025: 31.0.50; Can't activate bash-ts-mode without a shebang
Date: Sat, 15 Mar 2025 14:40:11 +0200
> Date: Sat, 15 Mar 2025 12:02:38 +0000
> From: the_wurfkreuz <the_wurfkreuz <at> proton.me>
> Cc: 77025 <at> debbugs.gnu.org
> 
> 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77025; Package emacs. (Mon, 17 Mar 2025 06:51:02 GMT) Full text and rfc822 format available.

Message #17 received at 77025 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 77025 <at> debbugs.gnu.org, the_wurfkreuz <the_wurfkreuz <at> proton.me>
Subject: Re: bug#77025: 31.0.50; Can't activate bash-ts-mode without a shebang
Date: Sun, 16 Mar 2025 23:49:44 -0700

> On Mar 15, 2025, at 5:40 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> Date: Sat, 15 Mar 2025 12:02:38 +0000
>> From: the_wurfkreuz <the_wurfkreuz <at> proton.me>
>> Cc: 77025 <at> debbugs.gnu.org
>> 
>> 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



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77025; Package emacs. (Mon, 17 Mar 2025 10:43:05 GMT) Full text and rfc822 format available.

Message #20 received at 77025 <at> debbugs.gnu.org (full text, mbox):

From: the_wurfkreuz <the_wurfkreuz <at> proton.me>
To: Yuan Fu <casouri <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 77025 <at> debbugs.gnu.org
Subject: Re: bug#77025: 31.0.50; Can't activate bash-ts-mode without a shebang
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 <casouri <at> gmail.com> wrote:

> > On Mar 15, 2025, at 5:40 AM, Eli Zaretskii eliz <at> gnu.org wrote:
> > 
> > > Date: Sat, 15 Mar 2025 12:02:38 +0000
> > > From: the_wurfkreuz the_wurfkreuz <at> proton.me
> > > Cc: 77025 <at> debbugs.gnu.org
> > > 
> > > 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77025; Package emacs. (Sat, 29 Mar 2025 11:28:02 GMT) Full text and rfc822 format available.

Message #23 received at 77025 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: the_wurfkreuz <the_wurfkreuz <at> proton.me>
Cc: casouri <at> gmail.com, 77025 <at> debbugs.gnu.org
Subject: Re: bug#77025: 31.0.50; Can't activate bash-ts-mode without a shebang
Date: Sat, 29 Mar 2025 14:27:05 +0300
> Date: Mon, 17 Mar 2025 10:42:28 +0000
> From: the_wurfkreuz <the_wurfkreuz <at> proton.me>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 77025 <at> debbugs.gnu.org
> 
> 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.

So can we close this bug, or is there something else left to do here?




Reply sent to Yuan Fu <casouri <at> gmail.com>:
You have taken responsibility. (Sat, 29 Mar 2025 16:43:02 GMT) Full text and rfc822 format available.

Notification sent to the_wurfkreuz <the_wurfkreuz <at> proton.me>:
bug acknowledged by developer. (Sat, 29 Mar 2025 16:43:02 GMT) Full text and rfc822 format available.

Message #28 received at 77025-done <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 77025-done <at> debbugs.gnu.org, the_wurfkreuz <the_wurfkreuz <at> proton.me>
Subject: Re: bug#77025: 31.0.50; Can't activate bash-ts-mode without a shebang
Date: Sat, 29 Mar 2025 09:41:51 -0700

> On Mar 29, 2025, at 4:27 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> Date: Mon, 17 Mar 2025 10:42:28 +0000
>> From: the_wurfkreuz <the_wurfkreuz <at> proton.me>
>> Cc: Eli Zaretskii <eliz <at> gnu.org>, 77025 <at> debbugs.gnu.org
>> 
>> 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.
> 
> So can we close this bug, or is there something else left to do here?

I think what bash-ts-mode does right now is reasonable, so closing the bug.

Yuan



bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 27 Apr 2025 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 53 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.