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

The path part doesn't show #166

Closed
w3ntao opened this issue Apr 19, 2019 · 13 comments · Fixed by #283
Closed

The path part doesn't show #166

w3ntao opened this issue Apr 19, 2019 · 13 comments · Fixed by #283
Labels
🐛 bug something that doesn't works as expected 🙏 help wanted needs PR or help on decision

Comments

@w3ntao
Copy link

w3ntao commented Apr 19, 2019

Env

Pure

echo $pure_version

2.1.5

Fish

fish --version

fish, version 3.0.2

OS/distribution

lsb_release -a

Distributor ID: Debian
Description: Debian GNU/Linux 9.8 (stretch)
Release: 9.8
Codename: stretch

The path part doesn't show:

Screenshot from 2019-04-19 14-02-02

@edouard-lopez
Copy link
Member

Could you try select the line on top of the prompt to see if it's empty?

Also a different theme might work better. If so, you can adjust color by overriding conf.d/pure.fish variables in your ~/.config/fish/config.fish

@edouard-lopez edouard-lopez added the ❓discussion understanding the project and its choices label Apr 19, 2019
@w3ntao
Copy link
Author

w3ntao commented Apr 19, 2019

Hi @edouard-lopez , I tried copy the path line to some editor and got nothing, changed a few theme and still seeing nothing. Looks like it's indeed empty.

@w3ntao
Copy link
Author

w3ntao commented Apr 20, 2019

It's working now.
I can't reproduce this bug any more...

@w3ntao w3ntao closed this as completed Apr 20, 2019
@w3ntao
Copy link
Author

w3ntao commented May 18, 2019

Having exact the same problem again (with Debian/buster).

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux buster/sid
Release:        testing
Codename:       buster

@w3ntao w3ntao reopened this May 18, 2019
@edouard-lopez
Copy link
Member

Could you try to call directly the function _pure_prompt_first_line, the one responsible to print this line:

source $__fish_config_dir/functions/_pure_prompt_first_line.fish
echo output: (_pure_prompt_first_line)

@ozelotdev
Copy link

ozelotdev commented Sep 26, 2019

maybe: it will be solved by installing git

How to reproduce problem
# Run docker
docker run --rm -it centos:7

# Install fish
curl --location --output /etc/yum.repos.d/shells:fish:release:3.repo https://download.opensuse.org/repositories/shells:/fish:/release:/3/CentOS_7/shells%3Afish%3Arelease%3A3.repo
yum install -y fish

# Launch fish
fish

# Install fisher
curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish

# Install pure
fisher install rafaelrinaldi/pure

@DrPhil
Copy link

DrPhil commented Oct 15, 2019

I can recreate this problem by having _pure_prompt_first_line be longer than what fits in my terminal without wrapping. You can test by creating a git branch with a very long name like I do in this picture. If I then resize my terminal the prompt will show.

image

Maybe _pure_print_prompt should try to cut the prompt, or try to shorten the branch name if it is long. Unfortunately string sub -l $COLUMNS $prompt is not good enough. (e.g. set_color or emojis will break that approximation.) Anyone with more insight in how to cut a fish string based on rendered length?

@andreiborisov
Copy link
Collaborator

Unfortunately string sub -l $COLUMNS $prompt is not good enough (e.g. set_color or emojis will break that approximation).

We take into consideration ANSI colors already (see https://github.com/rafaelrinaldi/pure/blob/master/functions/_pure_string_width.fish), however, there is no way to tell the printed length beforehand exactly.

I've opened another issue to discuss this: #198.

@andreiborisov andreiborisov added 🐛 bug something that doesn't works as expected and removed ❓discussion understanding the project and its choices labels Dec 14, 2019
@andreiborisov andreiborisov added this to the ⏩ v2.4.x-next milestone Dec 15, 2019
@andreiborisov andreiborisov self-assigned this Dec 15, 2019
@kidonng
Copy link
Contributor

kidonng commented Jul 7, 2020

@ozelotjp Running into this issue, installing Git solved it.

@andreiborisov andreiborisov removed their assignment Jul 7, 2020
@edouard-lopez edouard-lopez added the 🙏 help wanted needs PR or help on decision label Dec 27, 2020
@edouard-lopez
Copy link
Member

I'm happy to review PR for this one :)

@soredake
Copy link

I'm getting the same problem in fedora kde 36 vm with konsole.

@pauleikis
Copy link

I can confirm that I had the same issue and installing git solves it

edouard-lopez added a commit that referenced this issue Jan 4, 2023
@edouard-lopez
Copy link
Member

Using @ozelotjp I'm able to reproduce with :

❯ echo $pure_version 
> echo 4.4.0
4.4.0

Debugging

❯ set fish_trace 1


❯ _pure_prompt_first_line
> _pure_prompt_first_line
--> if
--> type -q --no-functions git
---> return 1
--> end if

Sound like git is missing, and we aborted the whole prompt in that case and we even have a test case for that

❯ type git
> type git
type: Could not find 'git'

So installing with git probably meant you installed it, thus resolving the issue. I will update the behaviour to skip git-related prompt when it's missing from the system, there is no need to require it anyway. See #313

edouard-lopez added a commit that referenced this issue Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug something that doesn't works as expected 🙏 help wanted needs PR or help on decision
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants