ble.sh: [gitstatus] `stty: invalid argument` on `source ble.sh`, patch 0.3.3
ble version: 0.3.3+7fa584c
Bash version: 5.0.17(1)-release, x86_64-redhat-linux-gnu
I downloaded Patch 0.3.3 and want to try it out:
$ source ble.sh
/usr/bin/stty: invalid argument ‘_ble_term_stty_flags_enter+=("${@:2}")’
Try '/usr/bin/stty --help' for more information.
When I source it a second time:
$ source ble.sh
[ble: reload]
stty: invalid argument ‘_ble_term_stty_flags_leave+=("${@:2}")’
Try 'stty --help' for more information.
stty: invalid argument ‘_ble_term_stty_flags_leave+=("${@:2}")’
Try 'stty --help' for more information.
bash: eval: line 254: syntax error near unexpected token `('
bash: eval: line 254: `exec _ble_util_openat_fdlist+=("${@:2}")>&-'
bash: eval: line 254: syntax error near unexpected token `('
bash: eval: line 254: `exec _ble_util_openat_fdlist+=("${@:2}")>&-'
bash: eval: line 254: syntax error near unexpected token `('
bash: eval: line 254: `exec _ble_util_openat_fdlist+=("${@:2}")>&-'
^[[39;2Rbash: 10#fields: value too great for base (error token is "10#fields")
/usr/bin/stty: invalid argument ‘_ble_term_stty_flags_enter[${#_ble_term_stty_flags_enter[@]}]="$2"’
Try '/usr/bin/stty --help' for more information.
\033[01;32m\u@\h\033[00m \033[01;34m\w\033[00m\n\033[01;31m$\033[00m \e]0;\u@\h: \w\abash: /home/ofey/.cache/blesh/./cmap+default.3.xterm-256color.dump: line 9: syntax error near unexpected token `('
bash: /home/ofey/.cache/blesh/./cmap+default.3.xterm-256color.dump: line 9: `_ble_decode_csimap_tilde=([1]=key=(\${*:2}))'
ble-bind: Unknown ble edit function `arr=(${*:2})'.
ble-bind: Unknown ble edit function `arr=(${*:2})'.
# ... About 150 lines replicate error.
ble-bind: Unknown ble edit function `arr=(${*:2})'.
bash: seq=(${*:2}): syntax error: operand expected (error token is "${*:2})")
Besides, my stty
version is: 8.32
$ stty --version
stty (GNU coreutils) 8.32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David MacKenzie.
After all, thank you all for creating this good thing.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (7 by maintainers)
Sorry for the late reply. I’m now busy, so it will take some time to think about what is the proper way of the workaround and to implement it.
OK, I see. It’s
exec
but noteval
, but this seems to be the same problem caused bygitstatus.plugin.sh
.Nice to meet you! And, thank you for trying out
cxxmatrix
!I think maybe I cannot make a satisfactory answer for you since I mainly learned Bash by reading
man bash
and searching related materials by taking a long time. When I started to use Bash, I have read some sections ofman bash
that seem to be useful, and gradually expanded to the other sections. When I found inman bash
some Bash features that I couldn’t get how to use, I searched it by Google, read related pages, and tried it by writing actual scripts. This is the way I learned Bash.man bash
for a good summary. A more detailed description of Bash can be found in Bash Reference Manual through HTML or the commandinfo bash
.bug-bash
andhelp-bash
(see the next item).man bash
, it would be also useful to subscribe bug-bash mailing list and help-bash mailing list to learn detailed Bash behaviors and techniques which are not fully documented in Bash man pages and manuals, but about which people often have questions. (Though just recently some guy is posting many unthoughtful questions and complaints.)There are also some popular documents, but I don’t fully recommend them. They will provide you some interesting techniques, but some techniques are not robust, so be careful:
I think you can put
GITSTATUS_STOP_ON_EXEC=0
before the source ofgitstatus.plugin.sh
(instead of completely disablinggitstatusd
).Right. You can see the initialization process again after
rm -rf "$_ble_base_cache"/*
.@ofey404 @SuperSandro2000 I’ve reported the issue of
gitstatus.plugin.sh
at https://github.com/romkatv/gitstatus/pull/235, and a fix has been made in the master ofgitstatus
. I think the root cause ofalias builtin
andalias exec
will be solved in the next release ofgitstatus
. Now let me close this issue.Thank you very much for reporting the issue and having provided us with a related issue with
gitstatus
anddocker
!Thank you for the information!
Could we keep it open for a while? I think we should report it to
gitstatus
, but currently I’m busy. I actually would like to suggestgitstatus
changing to turn off the replacement of builtins by default. In order to support the change, I would like to collect the patterns that can be broken by replacingexec
andbuiltin
, but it may take time.builtin eval
would see wrong positional parameters$1, $2, ..., $@
ifbuitlin
is replaced by a function.builtin source file
(without arguments) also have the same problem.exec 3> file
is not persistent after theexec
ifexec
is replaced by a function.sudo docker exec
would be affected by the alias.But I haven’t yet really tested them.
P.S. ⭐ bash-git-prompt seems fully compatible with
ble.sh
.Besides, maybe we should close this issue?
Thank you. I actually cannot reproduce the behavior, but with
builtin() { "$@"; }
I could reproduce a similar behavior. Ifbuiltin
oreval
is not replaced, currently I don’t have an idea what happens in your environment. To narrow down the problem, I have additional questions:ble.sh
(i.e.,master
branch)?