HP-UX: bash 3.0 vs 3.2

Many of our customers run our software on HP-UX. I had a call from one such customer recently and I had to reproduce the problem on in-house HP-UX.

I chose to use a new HP-UX machine on remote location. After a  few days, I noticed bash behaves a little differently. When I type in long command line, it scrolls the line to the left making head of the line invisible. This is not desirable because it makes copy&paste impossible. So, I started investigating.

First thing I found is that this feature is called 'horizontal-scroll-mode'.
$ man bash 2>/dev/null | ggrep -A 2 scroll
     horizontal-scroll-mode (Off)
          When set to On, makes readline use a  single  line  for
          display,  scrolling  the input horizontally on a single
          screen line when it  becomes  longer  than  the  screen
          width rather than wrapping to a new line.

So, I flipped the setting but it made no difference. It was set to 'off' to begin with, anyway.
$ bind -v | grep scroll
set horizontal-scroll-mode off
$ bind 'set horizontal-scroll-mode on'
$ bind -v | grep scroll
set horizontal-scroll-mode on
$ bind 'set horizontal-scroll-mode off'
$ bind -v | grep scroll
set horizontal-scroll-mode off
$
<a pretty long command line. This is a pretty long command line. This is a pretty long command line.

So, I googled and found that this is related to termcap/terminfo setting. On HP-UX, this capability seems to be called 'cuu1'.
$ man terminfo 2>/dev/null | grep cuu1
 cursor_up                 cuu1    up   Upline (cursor up)

It is defined in terminfo and for current session. It works, too.
$ echo $TERM
xterm
$ untic | grep -w cuu1
        cnorm=\\E[?25h, cuf1=\\E[C, cuu1=\\E[A, cvvis=\\E[?25h,

$ tput cuu1 | more
\^[[A
In desperation, I logged on older HP-UX machine and checked. It worked! I compared 'untic' output but there's no difference.

So, I started to suspect bash bug and checked version on both machines.
  1. older HP-UX
    $ bash --version
    GNU bash, version 3.2.0(2)-release (hppa2.0w-hp-hpux11.11)
    Copyright (C) 2005 Free Software Foundation, Inc.
  2. newer HP-UX
    $ bash --version
    GNU bash, version 3.00.16(1)-release (hppa2.0w-hp-hpux11.23)
    Copyright (C) 2004 Free Software Foundation, Inc.

Yeah, this was it. Newer HP-UX had older version bash. Probably, bash 3.0 had HP-UX specific bug. I can now copy&paste happily, as I did in this entry. :)
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
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
   
       
Today