Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Fix font issue debugging script #923

Merged
merged 3 commits into from
Aug 31, 2018

Conversation

dritter
Copy link
Member

@dritter dritter commented Jul 20, 2018

The new GitHub Issue Templates show that a lot of folks have trouble with fonts and problems with the debug/font-issues.zsh script. The script is a port of the font detection from dylanaraps/neofetch. In the our previous version I missed some functions (get_ppid and get_process_name) that now cause trouble.
Last but not least, I updated the font detections functions.

It would be super helpful if somebody could test this under WSL and Linux.

@JulienPivard
Copy link
Contributor

JulienPivard commented Jul 21, 2018

All seems to be ok with Macos.

But with my Linux (debian) I have an error with ps.

error: improper list

Usage:
 ps [options]
...

So I took a look in your code and it look like the variable $os is not set and if I add os=$(uname) at the begining of the scripts the OS detection work. But this create an other problem trim is not found, but is the use of this command necessary ? The ideal would be to avoid having to install more soft to run your script.

@JulienPivard
Copy link
Contributor

JulienPivard commented Jul 21, 2018

If I add that function at the begining of the script

trim()
{
    local var="${*}"
    # remove leading whitespace characters
    var="${var#"${var%%[![:space:]]*}"}"
    # remove trailing whitespace characters
    var="${var%"${var##*[![:space:]]}"}"
    echo -n "${var}"
}

I have

===== Font debugging =====
You are using gnome-terminal with Font 

WARNING It does not seem like you use an Powerline-enabled or Awesome Terminal Font!
Please make sure that your font settings are correct!

I use a powerline font so I took another look in your script
and in the function get_term_font it have no case for gnome-terminal

@dritter
Copy link
Member Author

dritter commented Jul 21, 2018

Hah! Good point @JulienPivard !

As this is a port from neofetch, I'll have to lookup how they resolve their $OS. I overlooked this bug, because with a running P9K, there is a $OS present as well (but with other values probably).

I'll have a look into that tomorrow.

@JulienPivard
Copy link
Contributor

I did not know there was a $OS variable. But in the script there is $os and not $OS I think the problem is there. I take a look and $os return nothing but $OS return OSX for my mac and Linux for my debian. So i think it's juste a problem with the case :)

@dritter
Copy link
Member Author

dritter commented Jul 21, 2018

You are right. Here is the code that fills $os. Our variable is names $OS.
So, either we want to change $os to $OS and make the debugging script compatible with our values, or we want to add the get_os function as well. But that are thoughts for tomorrow. ;)

- Add trim function
- Make our $OS and neofetchs $os compatible
@dritter
Copy link
Member Author

dritter commented Jul 22, 2018

@JulienPivard I (hopefully) fixed the font debugging script. Could you give it another try?

@JulienPivard
Copy link
Contributor

get_process_name:10: aucun fichier ou dossier de ce type: /proc/ 1960/comm
grep: /proc/ 1960/status: No such file or directory
===== Font debugging =====
You are using  with Font 

WARNING It does not seem like you use an Powerline-enabled or Awesome Terminal Font!
Please make sure that your font settings are correct!

I think trim don't remove all the space.

@dritter
Copy link
Member Author

dritter commented Jul 23, 2018

Strange.. This must be broken in the original repo as well.. Anyway. I fixed it now.

@JulienPivard
Copy link
Contributor

It's work... for trim

===== Font debugging =====
You are using gnome-terminal with Font 

WARNING It does not seem like you use an Powerline-enabled or Awesome Terminal Font!
Please make sure that your font settings are correct!

@JulienPivard
Copy link
Contributor

if I have the time I would try with other terminals.

@bhilburn
Copy link
Member

Great idea, @dritter! This should help quite a bit. I would love to get this in for v0.6.6 to help with debugging going forward. Would you like to do further testing or is this ready to go?

@julienfalque - Thanks so much for spending the time to help us test this! That is extremely valuable for the project =)

@dritter
Copy link
Member Author

dritter commented Jul 25, 2018

@JulienPivard It would be great, if you could test this on other terminals as well!

@bhilburn I think we need a bit testing here. I'll try to test it soon (probably next week). But the Gnome Issue should be fixed in the neofetch repo. I want to keep the difference as small as possible, to be able to copy the code in the future again.

@dritter dritter mentioned this pull request Aug 5, 2018
onaforeignshore added a commit to onaforeignshore/powerlevel9k that referenced this pull request Aug 9, 2018
@bhilburn bhilburn merged commit ebd4414 into Powerlevel9k:master Aug 31, 2018
@bhilburn
Copy link
Member

This is now fixed in master, and the v0.6.6 release will include the fix. Thanks so much!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants