starship: SHLVL doesn't respond to spawning new subshells. Perhaps an Alacritty thing?

Current Behavior

With SHLVL enabled and a threshhold 1 it always prints that the shell level is 1, even when echo $SHLVL echos 4.

Expected Behavior

I would expect that if echo $SHLVL echos 4, the SHLVL module would also print 4.

Additional context/Screenshots

↕️  1 ~
➜ echo $SHELL
/bin/bash
↕️  1 ~
➜ bash
↕️  1 ~
➜ bash
↕️  1 ~
➜ bash
↕️  1 ~
➜ echo $SHELL
/bin/bash
↕️  1 ~
➜ echo $SHLVL
4
↕️  1 ~
➜ starship bug-report

Possible Solution

Environment

  • Starship version: 0.47.0
  • bash version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright © 2007 Free Software Foundation, Inc.
  • Operating system: Mac OS 10.14.6
  • Terminal emulator: alacritty 0.6.0-rc2 (2d781b5)

Relevant Shell Configuration


Starship Configuration

# Don't print a new line at the start of the prompt
add_newline = false

# Replace the "❯" symbol in the prompt with "➜"
[character]                            # The name of the module we are configuring is "character"
success_symbol = "[➜](bold green)"     # The "success_symbol" segment is being set to "➜" with the color "bold green"

# format = "$all"

# Disable the package module, hiding it from the prompt completely
# [package]
# disabled = true

[shlvl]
threshold = 1
disabled = false

[aws]
symbol = " "

[battery]
full_symbol = ""
charging_symbol = ""
discharging_symbol = ""

[docker]
symbol = " "

[git_branch]
symbol = " "

[haskell]
symbol = " "

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (8 by maintainers)

Most upvoted comments

Progress! The old version also works when you pass the --login flag:

↓1 ~
➜ echo $SHLVL
1
↓1 ~
➜ echo $SHELL
/bin/bash
↓1 ~
➜ /bin/bash --login
↓2 ~
➜ /bin/bash --login
↓3 ~
➜