Closed davesteinberg closed 1 year ago
Thanks for the detailed description! As a first step, I recommend that you update Bash to v5.0, this can be done through Homebrew. The shipped Bash v3 is ancient...
I'm also running Catalina, but with the powerline-multiline theme, in Terminal.app. A couple of comments:
BASH_SILENCE_DEPRECATION_WARNING
env variable is a good one - we might want to add that to the osx
plugin or to the default profile.xterm
plugin on macOS, not sure whether it does anything that Terminal doesn't do automatically.I tried the echo commands with my current setup, and I don't have these issues:
master → origin ~/.bash_it 08:56:06 ⚡ 86% nils.winkler
❯ echo 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
master → origin ~/.bash_it 08:56:35 ⚡ 86% nils.winkler
❯ echo 123456789012345678901234567890
123456789012345678901234567890
master → origin ~/.bash_it 08:56:46 ⚡ 86% nils.winkler
❯
This is what I have in my ~/.bash_profile
for the theme settings:
export BASH_IT_THEME='powerline-multiline'
export POWERLINE_LEFT_PROMPT='scm python_venv ruby cwd'
export BATTERY_AC_CHAR="⚡ "
export POWERLINE_PADDING=1
export POWERLINE_COMPACT=0
Maybe give this a try to see if the Powerline theme has the same issues for you?
@nwinkler Thanks for the excellent debugging instructions. As it turns out, I didn't have to go past your first suggestion. Switching to Bash 5 from Homebrew immediately solved the problems I was seeing.
I knew that macOS ships an ancient version of Bash, but I'd only thought of that as an inconvenience for my own scripting. I had no idea that using it would break Bash It or, to be honest, that upgrading would be so easy (I'm already using Homebrew).
Knowing this would have saved me a ton of time, and I wouldn't have wasted yours with this bug, either.
What would you think about declaring a Bash requirement (4.something?) and putting this information in the README's Installation section? Something like this?
Bash Dependency
Bash It requires Bash 4.?? or later to run correctly. Any reasonably current Linux distribution should have shipped with a compatible version of Bash. However, macOS users must upgrade from the included, obsolete Bash version 3. We recommend using Homebrew to do this:
$ brew install bash $ sudo sh -c 'echo /usr/local/bin/bash >> /etc/shells' $ chsh -s /usr/local/bin/bash
Also, now I don't think setting BASH_SILENCE_DEPRECATION_WARNING
is a good idea, since you only get the nag when you're using the ancient, macOS-included Bash, which we've just established you should not do. I've removed it from my own .bash_profile
.
I like the idea of having a note in the README. We might want to add that some functionality might work with Bash 3, but there's no guarantee that everything will work.
Closed in #2146 well done @dylanjtuttle :)
After using Bash-it very happily on Linux, I'm now trying it on macOS (10.15.5, with bash 3.2.57), and I'm having all sorts of weird line break/line wrap problems. The problems seem to stem from
scm_prompt_info
, as they don't appear when I'm using a theme that doesn't use it or when I'm not in a git repo.The problems I'm seeing include unexpected line breaks in the middle of my prompt, early line wrapping (while I'm typing, before I get to the end of the line), line wrapping that doesn't actually advance to the next line (the cursor just returns to the beginning of the current line), and messing up the xterm title (I'm using the xterm plugin). However, the exact problems seem to vary with the theme, the terminal application (I've tried Terminal and iTerm, and both are affected), the width of the terminal window, the particular directory I'm in, and the previous command.
Here's a screen shot that shows most of these problems:
In the upper terminal, notice:
I'm using a custom theme here, but I see the same sorts of problems with built-in themes that use
scm_prompt_info
.I'm using just three plugins:
Here's my
.bash_profile
:It is the standard one created by the install script, with a few minor additions:
BASH_SILENCE_DEPRECATION_WARNING
to suppress the Catalina nag message when you use Bash.BASH_IT_CUSTOM
to point at the directory with my custom theme and aliases.BASH_IT_THEME
to select my custom theme.Here's my theme:
Bash-it is at
~/.bash_it
, but that is a symlink into my Dotbot-based dotfiles repo, where I've added Bash-it as a submodule.Strangely, what I did find solves the problem is simply commenting out the last line of my
.bash_profile
and then manually sourcingbash_it.sh
from within the interactive shell. That's what the lower terminal in the screen shot shows. Notice how I'm not able to reproduce any of the problems in it.I have no idea what could be different about letting
.bash_profile
sourcebash_it.sh
vs. manually doing it immediately afterward. So, I'm very stumped. I'm happy to try things out to get to the bottom of this, if any one has any ideas.