Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Line graphics on Linux console

Reply
Thread Tools

Line graphics on Linux console

 
 
frank@chagford.com
Guest
Posts: n/a
 
      01-29-2005
Hi all

I don't think this is strictly a Python problem, but as it manifests
itself in one of my Python programs, I am hoping that somebody in this
group can help me.

The following is a message I sent to co.os.linux.setup -

"My question concerns line graphics on a text-based console. *My
actual problem relates to a [Python] program I have written using
ncurses, b*ut you can easily test it by running a program like
minicom.

If you call up the minicom menu, it should be surrounded by *a nice
box made up of horizontal and vertical lines, corners, etc. It used to
work up until Redhat 7. Since upgrading to Redhat 9, and now Fedo*ra,
it (and my program) has stopped working."

I received the following reply from Thomas Dickey -

"That's because Redhat uses UTF-8 locales, and the Linux cons*ole
ignores vt100 line-drawing when it is set for UTF-8. (screen also
d*oes this).
ncurses checks for $TERM containing "linux" or "screen" (sin*ce
there's no better clues for the breakage) when the encoding is UTF-8*,
and doesn't try to use those escapes (so you would get +'s and -'s).
co*mpiling/linking with libncursesw would get the lines back for a
properly-wri*tten program."

I don't really understand the last sentence. Does anyone know if it is
possible to do this (or anything else) or am I stuck.
TIA for any advice.

Frank Millman

 
Reply With Quote
 
 
 
 
Frank Millman
Guest
Posts: n/a
 
      02-01-2005

Frank Millman wrote:
> Hi all
>
> The following is a message I sent to co.os.linux.setup -
>
> "My question concerns line graphics on a text-based console. *My
> actual problem relates to a [Python] program I have written using
> ncurses, b*ut you can easily test it by running a program like
> minicom.
>
> If you call up the minicom menu, it should be surrounded by *a nice
> box made up of horizontal and vertical lines, corners, etc. It used

to
> work up until Redhat 7. Since upgrading to Redhat 9, and now

Fedo*ra,
> it (and my program) has stopped working."
>
> I received the following reply from Thomas Dickey -
>
> "That's because Redhat uses UTF-8 locales, and the Linux cons*ole
> ignores vt100 line-drawing when it is set for UTF-8. (screen also
> d*oes this)."


For the record, I have found a solution, or at least a workaround.

I received the following suggestion from Steve (thanks Steve) -

"As a quick check to see if it's only the UTF-8 locales that are
affecting your program, try invoking your program, like so:

$ LANG=C <your-proggy>"

I tried this, but it did not work. However, it felt as if it ought to,
so I sent another message to Thomas Dickey (who, I have discovered, is
the maintainer of the ncurses library).

He replied that the console is probably still in unicode mode, but you
can turn it off with 'unicode_stop'.

I tried this and it worked - I did not even have to change the LANG
or TERM settings.

Obviously this will not work if you need unicode, but luckily for me I
do not, so it is a perfect workaround.

Frank Millman

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
linux console command line history kaklis@gmail.com Python 4 07-21-2010 08:03 AM
Preventing the console window from closing when writing a console program in C++ Miktor C++ 7 08-09-2005 09:22 PM
Re: console mp3->wav decoder for $indows or GUI one which supports console Serge Terekhoff Python 0 06-30-2003 12:36 PM
Re: console mp3->wav decoder for $indows or GUI one which supports console Egor Bolonev Python 0 06-30-2003 10:43 AM
Re: console mp3->wav decoder for $indows or GUI one which supports console Ben Finney Python 2 06-30-2003 05:43 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57