-
Notifications
You must be signed in to change notification settings - Fork 622
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
cannot display unicode char correctly #920
Comments
What about LANG and LC_* variables with and without sudo ? |
Like this. look the same..
|
LOCPATH maybe ? If it works for root, then the problem is not with tig. So it must be either one of the environment variables which is not retained by sudo or some files permissions. |
after upgrading tig from 2.3 to 2.4.1, I got this issue too. $ ldd ./tig $ ldd /usr/bin/tig |
UPDATE: |
Edit: Can't reproduce this fix / problem. |
Unicode should work independendtly from readline. Readline's code to initialize locale is slightly different from tig's. I don't reproduce the problem on my machine, could you try to compile tig without readline and with the following patch ? diff --git a/src/tig.c b/src/tig.c
index 25fd778..16a5de2 100644
--- a/src/tig.c
+++ b/src/tig.c
@@ -819,7 +819,7 @@ main(int argc, const char *argv[])
die("Failed to setup signal handler");
#endif
- if (setlocale(LC_ALL, "")) {
+ if (setlocale(LC_CTYPE, "")) {
codeset = nl_langinfo(CODESET);
} |
I can't reproduce the original problem after uninstalling |
Could it be that while installing libreadline-dev the package manager fixed the permissions to the directory containing the locales definitions ? It could also explain why it works with root user for the OP. |
I thought I ran into this problem to, but after some head scratching, it turned out in my case that when run via sudo, I was using the version of tig installed from the package manager. When run as my local user, I was using the version I had just compiled....without the ncursesw library available. |
I'm having this problem when compiling myself as well.
LANG, LC_ALL and LC_LANG is "en_US.UTF-8". |
Sorry for the noice, all I had to do was add the following in a config.make file (just as the INSTALL.asoc file says):
|
Great that you got it working. Is there any reason why you didn't use configure ? |
Only because using config.make was earlier in the documentation so it led be to believe it was the recommended way. |
Would that have been enough to make you use the configure script ? --- a/INSTALL.adoc
+++ b/INSTALL.adoc
@@ -27,8 +27,8 @@ By default, `tig` is installed in `$HOME/bin`. To install `tig` elsewhere set
Additional build options can be defined in the `config.make` file, which is
loaded automatically when running `make` if it exists. By default,
`contrib/config.make-$kernel_name` is loaded if it exists (currently only
-available for macOS [`Darwin`] and Cygwin). See `contrib/config.make` for
-example build options.
+available for macOS [`Darwin`] and Cygwin, Linux users should prefer the
+`configure` script). See `contrib/config.make` for example build options.
Documentation files, such as manpages, are distributed in the release tarballs,
and can be installed using: |
Probably, yes :) |
Running the configure script fixed it for me. |
References jonas#920
References jonas#920
References jonas#920
I have read the issues about unicode, have known that linking libncursesw can solve those trouble.
but i think i find a new problem.
typing
tig
, it shows:typing
sudo tig
, it shows:./configure
logging:check the libraries:
that is say, tig has link to libncursesw, but it display correctly in ROOT permission only..
have any idea? THX :)
The text was updated successfully, but these errors were encountered: