Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default prompts for execution time and plugged in status not correct on macOS Sierra #481

Closed
mraible opened this issue Nov 2, 2016 · 9 comments
Labels
bash Related to Bash specific implemetation MacOS X Related to MacOS X specific implementation

Comments

@mraible
Copy link

mraible commented Nov 2, 2016

Shell: bash/zsh
Operating system: macOS Sierra
Liquid Prompt version (tag, commit): 9c1c8a3

I have two MacBook Pros, one with OS X El Capitan (version 10.11.6) and one with macOS Sierra (10.12.1).

I have the same Liquid Prompt version on both machines and both are configured the same in my ~/.bash_profile. I haven't changed anything in the liquidprompt source tree. Everything works great on El Capitan. However, on macOS Sierra, the prompts are wrong.

macOS Sierra seems to add the time between commands rather than just showing how long it took to execute the last one. Also, it doesn't show that I'm plugged in. For example:

⌂69% [mraible:~/dev/liquidprompt] master 16s ± cd ~/dev/stormpath-sdk-java/
⌂66% [mraible:~/dev/stormpath-sdk-java] master 1m25s ± cd api/
⌂63% [mraible:~/dev/stormpath-sdk-java/api] master 1m27s ± mvn test
@dolmen
Copy link
Collaborator

dolmen commented Nov 27, 2016

Could you tell me the bash versions on each machines?

@dolmen dolmen added bash Related to Bash specific implemetation MacOS X Related to MacOS X specific implementation labels Nov 27, 2016
@asnr
Copy link

asnr commented Dec 10, 2016

I'm having a similar problem with liquidprompt showing the time since the shell started rather than the time spent executing the last command, but I'm running El Capitan. I installed liquidprompt with homebrew:

$ brew info liquidprompt
liquidprompt: stable 1.11, HEAD
Adaptive prompt for bash and zsh shells
https://github.com/nojhan/liquidprompt
/usr/local/Cellar/liquidprompt/1.11 (6 files, 124.3K) *
  Built from source on 2016-08-08 at 20:05:37
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/liquidprompt.rb

I'm running bash version

$ echo $BASH_VERSION
3.2.57(1)-release

on iTerm2 build 3.0.12 on El Capitan version 10.11.6 (15G1108).

@jasmas
Copy link

jasmas commented Jun 2, 2017

This is also not working for me on Sierra 10.12.5 (16F73) using either the built-in 3.2.57(1)-release version of bash or 4.4.12(1)-release version installed through homebrew.

@jasmas
Copy link

jasmas commented Jun 2, 2017

I just tested #476 and it appears to fix the plugged-in status for me.

@augmentedfourth
Copy link
Contributor

augmentedfourth commented Jan 5, 2018

@asnr Try brew install --HEAD liquidprompt. You'll get the more recent version of liquidprompt direct from the github repository, and not the latest (and far out of date) "release package."

@asnr
Copy link

asnr commented Jan 28, 2018

Thanks for the tip @augmentedfourth. I've done what you said:

$ ls -l /usr/local/share/liquidprompt
lrwxr-xr-x  1 someonemac  admin  54  9 Jan 08:01 /usr/local/share/liquidprompt -> ../Cellar/liquidprompt/HEAD-9c80396/share/liquidprompt

I'm still not getting any battery status, and the problem with the time between commands persists. These are some of my current environment:

$ echo $BASH_VERSION
3.2.57(1)-release
$ echo $LP_ENABLE_BATT
1
$ echo $LP_BATTERY_THRESHOLD
75

I'm running this on iTerm2 build 3.1.5 on macOS Sierra 10.12.6 (16G1036).

At 49% charge running off battery, this is what my prompt looks like:

[asnr:~] 13m57s $
[asnr:~] 13m58s $
[asnr:~] 13m58s $
[asnr:~] 13m59s $
[asnr:~] 13m59s $

(Note I pressed enter several times in quick succession but the timer keeps incrementing rather than resetting.)

@augmentedfourth
Copy link
Contributor

augmentedfourth commented Feb 3, 2018

@asnr The battery issue is well-known. There is an issue (#489) and two un-merged pull requests (#476, #536) attempting to fix it. I have no idea why neither of them are merged.

I've never experienced that timing issue, unfortunately, so I don't know what to say about that.

@Rycieos
Copy link
Collaborator

Rycieos commented Feb 5, 2018

Timing issues with the same symptoms described here are a common issue. Make sure you follow this comment if you are setting $PROMPT_COMMAND anywhere.

If this turns out to be the cause, that's at least four tickets with the same user error. Maybe we should add it as an FAQ.

@asnr
Copy link

asnr commented Feb 6, 2018

Thank you @Rycieos, that was it! It took a little while to figure out, because $PROMPT_COMMAND was being manipulated inside another utility (autojump, in my case).

Adding it to the FAQ isn't a bad idea. It might be worth mentioning explicitly in the README, under the heading 'Test drive and installation', say in the paragraph starting with 'To use it every time you start a shell, add the following lines to your .bashrc'.

overhacked added a commit to overhacked/liquidprompt that referenced this issue May 8, 2018
@Rycieos Rycieos closed this as completed Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bash Related to Bash specific implemetation MacOS X Related to MacOS X specific implementation
Projects
None yet
Development

No branches or pull requests

6 participants