I'm accessing an Ubuntu machine using PuTTY, and using gcc.
The default LANG environment variable on this machine is set to en_NZ.UTF-8, which causes GCC to think PuTTY is capable of displaying UTF-8 text, which it doesn't seem to be.
Maybe it's my font, I don't know - it does this:
foo.c:1: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â at end of input
If I set it with export LANG=en_NZ, then this causes GCC to behave correctly, I get:
foo.c:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
but this then causes everything else to go wrong. For example
man foo
man: can't set the locale; make sure $LC_* and $LANG are correct
I've trawled Google and I can't for the life of me find out what I have to put in there for it to just use ASCII. en_NZ.ASCII doesn't work, nor do any of the other things I can find.
Thanks
LANG=en_NZ is correct. However, you must make locale files for en_NZ.
For Ubuntu, edit /var/lib/locales/supported.d/local and add en_NZ ISO-8859-1 to the file. If your system is another distribution (including Debian), the location will be different. Look at /usr/sbin/locale-gen and see where it stores this info.
Afterwards, run locale-gen to create the en_NZ locale file. Hope this helps!
Putty can display utf - I think it is in appearance -> translation (or something, I don't have access to it right now).
For Debian 5.0 Lenny:
aptitude install locales
If that's already installed:
dpkg-reconfigure locales
Related
I'm running OS X 10.10.5. I'm getting an error trying to open a terminal:
tput: unknown terminal "xterm-256color"
This is obviously a missing termcap entry.
$ port list ncurses
ncurses #6.0 devel/ncurses
Any ideas how to install 'ncurses-term' on OS X?
$ sudo port install ncurses-term
Password:
Error: Port ncurses-term not found
The problem was with an Anaconda package:
https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/XKMFYqM12Vg
It appears there is some problem with an earlier version of the ncurses package that interferes with terminfo
conda install -c r ncurses
Notwithstanding the existence of bloated/monolithic packages on Linux, the package maintainers for ncurses packages often split up the 7Mb of terminfo into "base" and "term" chunks (and separate it from the library). The MacPorts maintainer for ncurses has not done this. The terminal database is part of the "ncurses" package. For instance, I see this from
port contents ncurses#6.0_0+universal
under /opt:
/opt/local/share/terminfo/73/screen.xterm-256color
Also there is a system (non-port) copy here:
/usr/share/terminfo/78/xterm-256color
Applications linked with ncurses will generally use one or the other, depending on whether they are linked with the port- or system-library. However, ncurses can be told to look some other place by setting the TERMINFO variable. If you happen to have copied some customization from another machine into your .bashrc, that could have set TERMINFO.
By itself, tput gives no clue where it is looking for a terminal entry. You can check the output from env to see if TERMINFO is set. The infocmp utility can show where it looks (since late 2011), using the -D option, e.g.,
$ infocmp -D
/usr/local/ncurses/share/terminfo
/usr/share/terminfo
/opt/local/share/terminfo
By the way, OSX does not (barring some specialized ports) use termcap as such. It uses terminfo, as part of some given release of ncurses (see for example the manual page for tgetent).
I'm on a fresh Virtualbox install of CentOS 6.4.
After installing zsh 5.0.2 from source using ./configure --prefix=/usr && make && make install and setting it as the shell with chsh -s /usr/bin/zsh, everything is good.
Then some time after, after installing python it seems, it starts acting strange.
Happens with PuTTY and iTerm2 over SSH, does not happen on the raw terminal through Virtualbox.
typing something, then erasing it: rather than removing the char and moving the cursor back, the cursor moves forward.
Typing Ctrl+V then Backspace repeatedly prints out this repeating pattern '^#?'
Running cat from zsh works fine. Prints out '^H' if I type that, backspaces like normal if I type normal backspace.
Surely someone's seen this before and knows exactly what the hell it is.
I'm not positive yet, but it seems that installing oh-my-zsh can fix this. But I really want to know what the specific issue is here.
OK , I suggest you try
export TERM=xterm
in your .zshrc configuration
the Changing into Zsh caused the bug.
sigh I knew I solved this before.
It's too damn easy to forget things.
The solution is to compile and apply the proper terminfo data with tic, as I have a custom config with my terminal clients, xterm-256color-italic, that confuses zsh.
There appear to be other ways to configure this stuff too; I basically just need it to be properly set up so italics work everywhere (including in tmux) so hopefully I can figure out how to do this more portably than I am currently.
I encounter the same problem when I manually install ZSH without root, when the backspace turns to blankspace but still functions as Backspace. Finally, I find it is because "ncurses" is not installed well.
tic: error while loading shared libraries: libncurses.so.6: cannot open shared object file: No such file or directory
? tic could not build /home/user/ceph-data/soft/ncurses-6.1/share/terminfo
After I reinstall the "ncurses", the problem of ZSH backspace is solved. Just for your information.
my $TERM is xterm-256color, by the way.
I have encountered a strange problem on one of our machines.
It is a fresh install of Debian Squeeze, with Postgres 8.4.10.
I have a few localizations installed on the machine, locale -a gives this:
C
en_US
en_US.iso88591
en_US.utf8
POSIX
swedish
sv_SE
sv_SE.iso88591
sv_SE.utf8
In the regular linux console I can use swedish localization (åäö works), but when I enter the psql console I can't use localized characters. Doesn't matter how I configure my terminal (tried just about every encoding I can think of).
The database itself works fine, I can input localized chars by making a SQL file and keep the inserts there. It's just no the most efficient way of doing it ;-)
Haven't run into this problem before, and I've installed quite a few machines. Does anyone have any idea of what could possibly be the cause of this?
I believe you're experiencing the problem explained in this bug report:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=608442
Summary: due to a licensing issue, psql is now linked to libedit instead of libreadline, and unfortunately libedit is broken/incomplete with regard to accented characters.
According to the report, a work-around is to launch psql with:
LD_PRELOAD=/lib/libreadline.so.5 psql
or upgrade the postgresql-common package to version 114 or higher. Since it's not in the stable branch, the easiest way may be to switch to backports:
# aptitude -t squeeze-backports install postgresql-common
Check the database encoding with \l then check the client encoding:
=> show client_encoding;
client_encoding
-----------------
UTF8
(1 row)
If they do not match then change the client encoding to that of the database:
set client_encoding=iso88591;
When I try to use ediff-revision under Emacs 23.2.1 for a CVS-managed file, I receive the following error in the *ediff-errors* frame, instead of commencing directly to the ediff results:
cygwin warning:
MS-DOS style path detected: c:/Users/BILL/AppData/Local/Temp/misc.cpp.~1.10~
Preferred POSIX equivalent is: /cygdrive/c/Users/BILL/AppData/Local/Temp/misc.cpp.~1.10~
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
My problem is that I have already set that CYGWIN environment variable option "nodosfilewarning", so I have no idea why I am receiving this error.
In fact, I can verify this right from an inferior shell under the same Emacs instance:
> set | grep -i nodos
CYGWIN=nodosfilewarning
I am running Cygwin 1.7.9-1 under Windows 7, in case this may be relevant (and I never had this problem before upgrading from Cygwin 1.5 to 1.7).
Any idea how to get rid of this error?
P.S. A subsequent call to ediff-revision succeeds without triggering this warning.
The CYGWIN variable is parsed when the first process in a Cygwin process tree is invoked. Hence, setting it in .bashrc or something like that is too late. A good place to set it is in the global Windows environment, under Control Panel->System->Advanced->Environment Variables.
I added (setenv "CYGWIN" "nodosfilewarning") to setup-cygwin.el. That seems to take care of the problem without, AFAICT, creating other problems. I also filed Emacs bug #14541 for this.
From within emacs, you may also:
M-x setenv
CYGWIN
nodosfilewarning
as an immediate alternative to altering setup-cygwin.el.
I don't print from vim often, so I am not sure when this happened.
I cannot print (ha[rdcopy] from vim or gVim.
I get the error
E365: Failed to print Postscript File
I am running on Ubuntu 10.04.
I am looking for ideas on things to configure as well as anyone who has had experience with this problem and might have an answer.
Not a lot of clues there...
Starting Vim with verbose turned on gvim -V
and doing :hardcopy might produce some clues.
Also, this might also be useful :set printexpr?
You can also check if the regular command lps is working, and whether you have the default printer set up correctly. Another useful command is set pdev=printer_name
I had the same error when my system had two printers configured with no default. Setting a default resolved the problem.
Excellent answer above. A few other pointers I'd like to share after just printing from Vim for the first time:
You can find your printer name in Ubuntu by checking the CUPS interface at http://localhost:631/printers/
To print without the file name header use:
set popt=paper:letter,header:0
Finally, you can print using:
hardcopy
In addition to set a default printer I fixed it installing gtklp:
$ sudo apt install gtklp