Subject: FVWM: newbie question

From: Ionel Mugurel Ciobîcă <[email-masked]>
Date: Thu, 13 Sep 2001 23:03:03 +0200

Hi all,

I do have a question which I don't know if it is appropriate
to this list. I am sorry if not. I am not actually a newbie,
I use fvwm since 4.5 years.

I configured fvwm under Debian to execute some commands
from my ~/bin directory.

For example small scripts to open a xterm with a rlogin command:

========cut here=========
xhost +bambam.chem.tue.nl
/usr/bin/X11/xterm -bg darkcyan -fg lightyellow -bd blue -cr magenta -sb -sl 1500 -j -ls -fn "-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-16" -name POŞTA -title POŞTA -e rlogin -8 -l tgakic bambam.chem.tue.nl &
========cut here=========

In my ~/.fvwm/main-menu.hook I have:

========cut here=========
...
AddToMenu "/Debian/Hosts" "Hosts%mini-telnet.xpm%" Title
+ "e-mail%mini-mail.xpm%" Exec exec ~/bin/mail
...
========cut here=========

When I click with the mouse on the "e-mail" I get my xterm running rlogin.
The same is happening when I simply call the script from an open xterm.

But they don't behave the same. My question is why? Two differences are
important. The name of the xterm is not the same. The one called from the
fvwm menu is OK and the other called from a xterm show a square made from
dashed lines, a minus, a capital B and then the 8bit character. This is
the same for any 8bit character.

The second difference is that in the xterm opened from the fvwm menu
the input of 8 bit characters are OK, while in the other one only few
are accepted. Example î and â are accepted in both, while ă, ţ or ş
are silently ignored. î and â are common in between latin1, latin2
and latin10, ă, ţ or ş are not.

I think that somehow the commands executed via the fvwm menu have a
different environment or something. I can't explain why this is
happening. Can someone gave me a hint in which direction to look for
an answer.

Thank you,

Ionel

P.S. This is not new, it is happening since a while. I run
"Fvwm Version 2.2.5 compiled on Jul 23 2001 at 09:35:46"
on Debian woody, 2.2.19 kernel.
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dan Espen <[email-masked]>
Date: Thu, 13 Sep 2001 17:30:04 -0400

> I use fvwm since 4.5 years.

So your subject line should be "not a newbie question"...

> /usr/bin/X11/xterm -bg darkcyan -fg lightyellow -bd blue -cr magenta -sb -sl 
> 1500 -j -ls -fn "-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-16" 
> -name POªTA -title POªTA -e rlogin -8 -l tgakic bambam.chem.tue.nl &

Hmm, that must be ~/bin/mail...

> the same for any 8bit character.

When you start the xterm with -ls it runs you login shell.
(Your .profile or .login.)  Perhaps something different is
happening than when you first log in.

The stuff with a capital B indicates a complex string in the
title.  You need fvwm2.4 built with enable multibyte to display
that correctly.  The client application (xterm in this case)
makes the title string
into a complex string.  We've found that Java does that based
on $LANG or one of the other Locale based environment variables.
Perhaps something similar is going on with xterm.

> are accepted. Example î and â are accepted in both, while ã, þ or º
> and latin10, ã, þ or º are not.
> 

Look for differences in environment variables. $LANG and $LCxxxx.

-- 
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Ionel Mugurel Ciobîcă <[email-masked]>
Date: Thu, 13 Sep 2001 23:51:47 +0200

În data de 13/09/2001, 17:30:04, Dan Espen a scris:
> Ionel Mugurel Ciobîcă <[email-masked]> writes:
> > Hi all,
> > 

Well, I did not configure fvwm too much, I was just using it.
So, in a way this is a newbie question.

I loked into doc and on the fvwm site, I found nothing similar.
> > -name PO?TA -title PO?TA -e rlogin -8 -l tgakic bambam.chem.tue.nl &

Yes, sorry.
> happening than when you first log in.

I access the same command from the fvwm menu and from an xterm.
Yes, the script have xterm -ls, which I know, it reads my .login
and .cshrc files.
> Perhaps something similar is going on with xterm.

So the problem is with xterm? I don't think so. If I call the same
script from rxvt, eterm, konsole, the same happened like with xterm.
The only way to get it right is via the fvwm menu.

> > are accepted. Example î and â are accepted in both, while ?, ? or ?
> > and latin10, ?, ? or ? are not.
> > 

Where shall I look for that? I know about the $LANG and $LC_xxxx
in my shell (in my .cshrc), I put that. How I know which 
environment variables are available for a command launched from
a fvwm menu?

Thank you,

Ionel

P.S. I joined the list, no need to cc me. Thank you.

---

From: Dan Espen <[email-masked]>
Date: Thu, 13 Sep 2001 18:45:48 -0400

Ionel Mugurel =?iso-8859-2?Q?Ciob=EEc=E3?= <[email-masked]> writes:
> > Ionel Mugurel Ciobîcã <[email-masked]> writes:
> > > Hi all,
...
> > > ========cut here========= (~/bin/mail

I'm not sure if I'd say xterm is doing something wrong.
I don't know if it needs to mark that string as a complex
string to display right.  I suspect that it doesn't.

Maybe you want to take the easy way out and download 2.4.0
and compile it with --enable-multibyte and be done with it.

> environment variables are available for a command launched from

Do this in the xterm to see whats set:

env | grep LANG
env | grep LC

I'm not quite sure what the difference is either.
You might want to put some print statements in your .profile
and .cshrc while you are trying to figure this out.

Do have $SHELL set?

Do you use the fvwm command ExecUseShell?

---

From: Ionel Mugurel Ciobîcă <[email-masked]>
Date: Fri, 14 Sep 2001 01:13:58 +0200

În data de 14/09/2001, 00:22:29, Dominik Vogt a scris:
> I guess the two xterms have different language environment
> variables (LC_... or LANG).
> 
Since those xterm I open are doing rlogin I can check it. (They
report the same environment.) I replaced the script with one which
is not doing rlogin, so I stay localy. I run setenv in both xterms
(from the fvwm menu, and from an other xterm). There are differences,
but only in the order of listing. WINDOWID is ofcourse different
and the PATH looks different (longer for the one with problems),
but in fact some path is listed twice.

All LC_ and LANG are the same.

Ionel

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 14 Sep 2001 00:29:45 +0200

On Thu, Sep 13, 2001 at 11:51:47PM +0200, Ionel Mugurel Ciobîc? wrote:
> > Ionel Mugurel Ciobîc? <[email-masked]> writes:
> > > Hi all,
> > > 

Just add the command

  set > /tmp/environment.$$

to the shell script.  This dumps the whole environment of the
script into the file /tmp/.environment.<process_id>.  Do this for
both types of xterm and compare the output.

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 14 Sep 2001 00:22:29 +0200

On Thu, Sep 13, 2001 at 11:03:03PM +0200, Ionel Mugurel Ciobîc? wrote:
> /usr/bin/X11/xterm -bg darkcyan -fg lightyellow -bd blue -cr magenta -sb -sl 1500 -j -ls -fn "-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-16" -name PO?TA -title PO?TA -e rlogin -8 -l tgakic bambam.chem.tue.nl &

Bye

Dominik ^_^  ^_^

---

From: Ionel Mugurel Ciobîcă <[email-masked]>
Date: Fri, 14 Sep 2001 01:50:06 +0200

> string to display right.  I suspect that it doesn't.

Where I can read about this "complex string"? I try to add
a "\" in front of the 8bit letter, also a  (Ctrl-V), is not
working. 

man -k "complex string" give no answer and in man xterm I
can't find complex string either. 
> and compile it with --enable-multibyte and be done with it.
Hmmm. As I said I have not problem with fvwm, in fact if I open the
script from the fvwm menu, that is OK. If I execute the script directly,
then I have problems. 
> Do this in the xterm to see whats set:

This I get also with setenv. They are OK, this is what I set myself.
> and .cshrc while you are trying to figure this out.

My .login (I use tcsh) and .cshrc are read OK.
> Do have $SHELL set?

Yes. 
> Do you use the fvwm command ExecUseShell?
No. I don't think so. But I can try.

If I replace

with

+ "e-mail%mini-mail.xpm%" ExecUseShell /usr/bin/tcsh exec ~/bin/mail

I don't get anything by pressing the mouse over e-mail,
and in .xsession-errors I have:

stdin: is not a tty

If I replace that with 

+ "e-mail%mini-mail.xpm%" ExecUseShell /usr/bin/tcsh ~/bin/mail

Then it is the same as the first time: OK.

Ionel

---

From: Ionel Mugurel Ciobîcă <[email-masked]>
Date: Fri, 14 Sep 2001 02:13:39 +0200

> both types of xterm and compare the output.

I just did that and now I understant even less...

diff environment.17839 environment.17844 (xterm versus fvwm)

< HOSTTYPE=i386-linux
> HOSTTYPE=i386

< LANG=ro_RO
> LANG=C

< MACHTYPE=i386
> MACHTYPE=i386-pc-linux-gnu

< OSTYPE=linux
> OSTYPE=linux-gnu

So, the script running from the fvwm menu is in fact running
with LANG=C. Well that is strange, because C means ASCII, 7bit
and shouldn't work. If I change LANG=C in a xterm and I run
the script I get a xterm where the name has no strange characters,
and all 8bit characters can be typed. If now I add 
export LANG=C and/or setenv LANG C in my script then it is not
working.

I should manage now to make it work, thank you.

Still, why LANG=C is OK for 8bit characters, and LANG=ro_RO
(or any other) it is not?

Ionel

---

From: Dan Espen <[email-masked]>
Date: Thu, 13 Sep 2001 20:36:44 -0400

> can't find complex string either. 

I don't think you can backslash the problem away.

When an application creates one of these titles fvwm displays
it correctly when it uses XmbDrawString to display
the string and displays it incorrectly when it uses just plain
XDrawString.  Somewhere in the man pages, I got the term
complex string for the difference.

I'm trying to figure out what makes xterm think it needs to
put out that sequence...

Ah, now I see your next mail.

...
> (or any other) it is not?

When in locale C, X works fine with 8 bit characters.
That strange stuff at the beginning of the tltle
comes from xterm deciding it needs to use multibyte.
I don't know why xterm is deciding that it needs multibyte,
it shouldn't need more than 8 bits even for Russian.

> I should manage now to make it work, thank you.

Good, because I'm beginning to suspect I don't know
what I'm writing about.

---

From: Ionel Mugurel Ciobîcă <[email-masked]>
Date: Fri, 14 Sep 2001 03:10:22 +0200

> Good, because I'm beginning to suspect I don't know

I think I have something broke in my locale ro_RO.
I will contact the right people to ask about.
Any other language is OK. I solve it temporary by
adding "export LC_ALL=C" in all the scripts...

Thank you,
	Ionel