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

Escaped characters(?) in output for PID and CPU. #21

Closed
bdmorin opened this issue Aug 18, 2019 · 18 comments
Closed

Escaped characters(?) in output for PID and CPU. #21

bdmorin opened this issue Aug 18, 2019 · 18 comments

Comments

@bdmorin
Copy link

bdmorin commented Aug 18, 2019

image

I'm getting odd escaped characters or something in my output for PID and CPU columns. Unsure where to start to troubleshoot this.

bdmorin@phester:~$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
@dalance
Copy link
Owner

dalance commented Aug 18, 2019

Could you explain your environment?
Especially terminal emulator.

@bdmorin
Copy link
Author

bdmorin commented Aug 18, 2019

yeah, after I hit submit I realized should've done this.

bdmorin@phester:~$ screenfetch
                          ./+o+-       bdmorin@phester
                  yyyyy- -yyyyyy+      OS: Ubuntu 19.04 disco
               ://+//////-yyyyyyo      Kernel: x86_64 Linux 5.0.0-25-generic
           .++ .:/++++++/-.+sss/`      Uptime: 1d 10h 41m
         .:++o:  /++++++++/:--:/-      Packages: 3539
        o:+o+:++.`..```.-/oo+++++/     Shell: bash 5.0.3
       .:+o:+o/.          `+sssoo+/    Resolution: 1920x1080
  .++/+:+oo+o:`             /sssooo.   DE: GNOME 
 /+++//+:`oo+o               /::--:.   WM: GNOME Shell
 \+/+o+++`o++o               ++////.   WM Theme: Arc-Dark
  .++.o+++oo+:`             /dddhhh.   GTK Theme: Arc-Dark [GTK2/3]
       .+.o+oo:.          `oddhhhh+    Icon Theme: Papirus-Dark
        \+.++o+o``-````.:ohdhhhhh+     Font: Ubuntu 11
         `:o+++ `ohhhhhhhhyo++os:      CPU: Intel Core i7-9750H @ 12x 4.5GHz [64.0°C]
           .o:`.syhhhhhhh/.oo++o`      GPU: GeForce RTX 2060
               /osyyyyyyo++ooo+++/     RAM: 4428MiB / 31876MiB
                   ````` +oo+++o\:    
                          `oo++.      

bdmorin@phester:~$ env | fgrep -i term
COLORTERM=truecolor
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/816aed81_859c_4c68_b830_9baaca3902b4
TERM=xterm-256color
GNOME_TERMINAL_SERVICE=:1.257
ZSH_TMUX_TERM=screen-256color

@bdmorin
Copy link
Author

bdmorin commented Aug 18, 2019

wider view, but obviously the same result.

image

I also tried this on a remote host, with

env | fgrep -i term
TERM=xterm

same behaviour

@dalance
Copy link
Owner

dalance commented Aug 18, 2019

The characters seems to be unicode character like │, ▲.
Please check gnome terminal setting: Terminal -> Set Character Encoding -> UTF-8.

@bdmorin
Copy link
Author

bdmorin commented Aug 18, 2019

image

Hmm.. I think it's set like that now.
I'm installing alacritty/kitty now, a different term emulator.

@dalance
Copy link
Owner

dalance commented Aug 18, 2019

Can your terminal show "▲"?

@bdmorin
Copy link
Author

bdmorin commented Aug 18, 2019

i copied that character and pasted it in my terminal, it seemed to work.

@dalance
Copy link
Owner

dalance commented Aug 18, 2019

Could you try procs --pager disable?

@bdmorin
Copy link
Author

bdmorin commented Aug 18, 2019

Welp.. That did it.
image

❯ env | rg -i less     
LESS=-iRFXMx4
LESSOPEN=| /usr/bin/env lesspipe %s 2>&-
❯ unset LESS      
❯ unset LESSOPEN
❯ env | rg -i less

After clearing these the same thing still happened. I'll look further at my pager settings.

@dalance
Copy link
Owner

dalance commented Aug 18, 2019

procs doesn't check LESS environment variable. If less command exists, less -SR is used.

@dalance
Copy link
Owner

dalance commented Aug 18, 2019

It is wrong. LESS is used by less.
What is your less version?

@dalance
Copy link
Owner

dalance commented Aug 19, 2019

I found the similar issue.
https://serverfault.com/questions/414760/how-to-make-the-less-command-handle-utf-8

Could you try below?

export LESSCHARSET=utf-8

@bdmorin
Copy link
Author

bdmorin commented Aug 20, 2019

❯ less -V             
less 487 (GNU regular expressions)
Copyright (C) 1984-2016  Mark Nudelman
export LESSCHARSET=utf-8

That did it!! YAY!

Thanks! I love procs!

@dalance
Copy link
Owner

dalance commented Aug 20, 2019

Thanks!

@dalance dalance closed this as completed Aug 20, 2019
@bergercookie
Copy link

Thanks for solving this, had the exact same issue with the same less version on Ubuntu 18.
Probably a note in the README file would help future ubuntu users.

Great software by the way, thanks for open-sourcing it.

@dalance
Copy link
Owner

dalance commented Sep 22, 2019

Thank you for your comment. I added installation note.

@lightonflux
Copy link

Is there a reason why this is not a default? Maybe we can create a bug report for Ubuntu or upstream less, so that this does not need to be changed. I don't really see a downside of using utf-8.

@dalance
Copy link
Owner

dalance commented Jan 29, 2020

I don't know the reason. But It seems to be intended by the author
bacause there is the solution using LESSCHARSET in the official FAQ.
http://greenwoodsoftware.com/less/faq.html#intl

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

No branches or pull requests

4 participants