WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: getlocale.sh fails silently in urxvt (rxvt.tcz) terminal  (Read 3270 times)

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
getlocale.sh fails silently in urxvt (rxvt.tcz) terminal
« on: August 03, 2020, 01:18:55 PM »
Running  getlocale.sh  in an urxvt terminal fails silently (nothing happens, no errors are shown):
Code: [Select]
$ sudo getlocale.sh
$

A little investigating reveals the problem:
Code: [Select]
$ sudo dialog --file /tmp/tmp.0vWiFQ
Error opening terminal: rxvt-unicode-256color.
$ echo $TERM
rxvt-unicode-256color

The fix:
Code: [Select]
$ export TERM=rxvt # or export TERM=xterm
$ sudo getlocale.sh # now it works :)

Maybe export TERM=rxvt or export TERM=xterm should be at the top of the getlocale.sh script (which is part of the  getlocale.tcz  extension)

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: getlocale.sh fails silently in urxvt (rxvt.tcz) terminal
« Reply #1 on: August 03, 2020, 01:31:56 PM »
P.S. The  rxvt-unicode-256color  value of the TERM variable has causes problems for me before (some other application or script--I can't remember exactly what it was--wouldn't work until I did export TERM=rxvt).

@andyj - is there a particular reason why the urxvt terminal sets  TERM  to  rxvt-unicode-256color  ? If possible, setting the value to simply  rxvt  would avoid this and similar problems.
« Last Edit: August 03, 2020, 01:46:52 PM by GNUser »

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 934
Re: getlocale.sh fails silently in urxvt (rxvt.tcz) terminal
« Reply #2 on: August 03, 2020, 03:50:21 PM »
Hi, GNUser and all Core people!

You can change rxvt TERM variable using .Xdefaults. Add the string
Code: [Select]
urxvt*termName: rxvt
and in new urxvt window You'll got:
Code: [Select]
tc@box:~$ echo $TERM
rxvt

Side effect of this action is, that, for example, mc will not be able to use 256-color themes, .
« Last Edit: August 03, 2020, 03:53:19 PM by jazzbiker »

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: getlocale.sh fails silently in urxvt (rxvt.tcz) terminal
« Reply #3 on: August 03, 2020, 04:17:55 PM »
Urxvt sets TERM by default to rxvt-unicode-256color in the source. There isn't anything in the extension which changes this behavior. I used getlocale.sh with rxvt and it worked for me, I can not reproduce the problem. You can also change it on the command line with the -tn option.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: getlocale.sh fails silently in urxvt (rxvt.tcz) terminal
« Reply #4 on: August 03, 2020, 04:41:16 PM »
You can change rxvt TERM variable using .Xdefaults.
Thank you, jazzbiker. I learned something new. I'll do that--I use rxvt for the unicode (not for the colors), so no love lost.

I used getlocale.sh with rxvt and it worked for me, I can not reproduce the problem.
Thanks for trying to reproduce it, andyj, and for clarifying that the TERM variable value is set by upstream developers and not by the TCL packager (you). I'm puzzled that the issue affects my rig but not yours. Very mysterious. If I find an explanation, I'll make a follow-up post in this thread.
« Last Edit: August 03, 2020, 04:43:38 PM by GNUser »

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: getlocale.sh fails silently in urxvt (rxvt.tcz) terminal
« Reply #5 on: August 03, 2020, 05:09:57 PM »
I try to keep my VM setup minimal so my extensions don't pull in things I don't want when I compile them. My desktop is flwm, and I'm using Xorg 3d. I don't know if this helps or not:

Code: [Select]
tc@box:~$ xdpyinfo
name of display:    :0.0
version number:    11.0
vendor string:    The X.Org Foundation
vendor release number:    12006000
X.Org version: 1.20.6
maximum request size:  16777212 bytes
motion buffer size:  256
bitmap unit, bit order, padding:    32, LSBFirst, 32
image byte order:    LSBFirst
number of supported pixmap formats:    7
supported pixmap formats:
    depth 1, bits_per_pixel 1, scanline_pad 32
    depth 4, bits_per_pixel 8, scanline_pad 32
    depth 8, bits_per_pixel 8, scanline_pad 32
    depth 15, bits_per_pixel 16, scanline_pad 32
    depth 16, bits_per_pixel 16, scanline_pad 32
    depth 24, bits_per_pixel 32, scanline_pad 32
    depth 32, bits_per_pixel 32, scanline_pad 32
keycode range:    minimum 8, maximum 255
focus:  window 0x1200006, revert to PointerRoot
number of extensions:    28
    BIG-REQUESTS
    Composite
    DAMAGE
    DOUBLE-BUFFER
    DPMS
    DRI2
    DRI3
    GLX
    Generic Event Extension
    MIT-SCREEN-SAVER
    MIT-SHM
    Present
    RANDR
    RECORD
    RENDER
    SHAPE
    SYNC
    VMWARE_CTRL
    X-Resource
    XC-MISC
    XFIXES
    XFree86-DGA
    XFree86-VidModeExtension
    XINERAMA
    XInputExtension
    XKEYBOARD
    XTEST
    XVideo
default screen number:    0
number of screens:    1

screen #0:
  dimensions:    1918x998 pixels (507x264 millimeters)
  resolution:    96x96 dots per inch
  depths (7):    24, 1, 4, 8, 15, 16, 32
  root window id:    0x405
  depth of root window:    24 planes
  number of colormaps:    minimum 1, maximum 1
  default colormap:    0x20
  default number of colormap cells:    256
  preallocated pixels:    black 0, white 16777215
  options:    backing-store WHEN MAPPED, save-unders NO
  largest cursor:    64x64
  current input event mask:    0xda403f
    KeyPressMask             KeyReleaseMask           ButtonPressMask         
    ButtonReleaseMask        EnterWindowMask          LeaveWindowMask         
    KeymapStateMask          StructureNotifyMask      SubstructureNotifyMask   
    SubstructureRedirectMask PropertyChangeMask       ColormapChangeMask       
  number of visuals:    408
  default visual id:  0x21
  visual:
    visual id:    0x21
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits
{rest snipped}

Code: [Select]
tc@box:~$ cat .Xdefaults
fltk*scheme: gtk+
Xft.dpi: 96.0
Xft.autohint: 0
Xft.lcdfilter: lcddefault
Xft.hintstyle: hintslight
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb
URxvt*scrollBar: true
URxvt*transparent: true
URxvt*title: Terminal
URxvt*foreground: white
URxvt*background: black
#URxvt*font: xft:DejaVu Sans Mono:style=Book:size=10
URxvt*font: xft:Hack:style=Regular:size=10
#URxvt*font: xft:Unifont:style=Regular:size=12
#URxvt*font: xft:Noto Sans Disp Blk:style=Regular:size=10
#URxvt*font: xft:Terminus:style=Regular:size=20
URxvt*cursorColor: green
URxvt*fading: 20
URxvt*shading: 50
URxvt*color12: DodgerBlue1
URxvt*saveLines: 1000
URxvt*letterSpace: 0
URxvt*iso14755: 1

You can see I have tried a few fonts. I'm using Hack for now. If you think of something else that might be helpful let me know.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: getlocale.sh fails silently in urxvt (rxvt.tcz) terminal
« Reply #6 on: August 03, 2020, 08:41:29 PM »
I tinkered a bit more and realized that the problem only occurs on my TCL system where urxvt is just a binary (i.e., rxvt.tcz is not loaded). Loading rxvt.tcz makes the problem go away, presumably because the extension provides this file: /usr/local/share/terminfo/r/rxvt-unicode-256color.

I'm terribly sorry for the noise :-[ In the future, I'll make sure to try to reproduce my "problem" on a standard TCL setup before I start a thread asking for help.

P.S. For the non-standard system in question, jazzbiker's workaround is perfect. Thanks jazzbiker!

aus9

  • Guest
Re: getlocale.sh fails silently in urxvt (rxvt.tcz) terminal
« Reply #7 on: August 04, 2020, 02:52:28 AM »
Quote
If you think of something else that might be helpful let me know.

beauty and size is in the eye of the beholder

mononoki font 18 pts for rxvt to the right and sakura to the left same font but 17 points
If interested in clicking....rxvt is a bit strong in the colours while sakura is weaker
https://imgur.com/PjcKFqw

Notice the zero is O with a slash

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: getlocale.sh fails silently in urxvt (rxvt.tcz) terminal
« Reply #8 on: August 05, 2020, 06:10:09 PM »
I ran into the same upstream thing on Porteus, where a few programs like htop, mc etc would fall over with the normal default system TERM environment variables.

What I did was to call up those few programs having problems where they demand a certain TERM variable otherwise they would fail.

Example - for htop, I ran it like this:

Code: [Select]
TERM=xterm htop
Then, for convenience, I used an alias for htop to call it like this from then on.  Same thing for mc. 

By using an alias to call them with the TERM value that works best for those upstream issues, without totally changing the global TERM variable, this seemed to be the band-aid for those few programs which aren't playing nicely.

I think.  I wasn't smart enough to claim credit - the devs suggested it.  :)
« Last Edit: August 05, 2020, 06:19:14 PM by PDP-8 »
That's a UNIX book! - cool  -- Garth