* Re: zsh & HP Term
@ 2000-04-27 8:02 Ville Herva
2000-04-28 4:19 ` Bart Schaefer
0 siblings, 1 reply; 5+ messages in thread
From: Ville Herva @ 2000-04-27 8:02 UTC (permalink / raw)
To: zsh-users
Bart Schaefer wrote:
> On Mar 31, 12:16pm, rodriguez_ruggeberg@non.hp.com wrote:
> } Subject: zsh & HP Term
> }
> } [...] to my amazement, the program could not pick the arrow keys as
> } being pressed! This leads me to believe that either the device for
> } the HP term is "swallowing" the arrow keys, or that the system just
> } uses a different system to comunicate the arrow keys.
>
> HPTerm terminals date from the days when even direct connections to the
> mainframe were at 300 baud and it was important to transmit as little as
> possible between the terminal and the host. So the HPTerm has all sorts
> of smarts of its own -- all the cursor movement and forms-based data
> entry takes place *in the terminal*, and then a whole screenful of it
> is sent back at once.
Propably not strictly related to zsh, but I'll ask anyway: I'm having a
bit different problem with terminal under HPUX 10.20. Most if not all
programs I run seem to ruin my terminal settings so that when I return to
zsh, arrow keys work no more. When I login (using ssh under xterm) I can
use arrow keys, but after for example using less, arrow keys just produce
'A' and 'B' and some control characters. When I press up and down arrow, I
get 'A', and 'B' on the next line. The cursor is then after 'A':
prompt % A_
B
Most of the time 'reset' restores the arrow keys, but not always. ttyctl
-f does not help. This also happens very rarely under linux. Sometimes
when I log out from HPUX back to linux, the arrow keys are still missing
(most of the time, they are not). In this case, they seem to be harder to
restore.
Now, I believe this must be quite a typical problem, but I've not found a
cure. I've also not found a good FAQ or web page on these terminal
problems. Typing reset after every command is tedious. Perhaps somebody
could help me here?
--
"Olet sietämätön tyyppi
Ja mielipiteesi ovat vääriä
Älä soita tänne enää koskaan!" - Ultra Bra
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: zsh & HP Term
2000-04-27 8:02 zsh & HP Term Ville Herva
@ 2000-04-28 4:19 ` Bart Schaefer
2000-04-28 12:27 ` Ville Herva
0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2000-04-28 4:19 UTC (permalink / raw)
To: Ville Herva, zsh-users
On Apr 27, 11:02am, Ville Herva wrote:
} Subject: Re: zsh & HP Term
}
} Propably not strictly related to zsh, but I'll ask anyway: I'm having a
} bit different problem with terminal under HPUX 10.20. Most if not all
} programs I run seem to ruin my terminal settings so that when I return to
} zsh, arrow keys work no more.
Many terminals have two modes, the "normal" mode and the "keypad" mode.
The arrow keys often send different character sequences in the different
modes. What's happening is that your terminal is getting switched from
one mode to the other and not switched back. This is probably a result
of a problem with the termcap or terminfo description of your terminal.
The easiest thing to do is use bindkey to bind both the keypad and normal
arrow key sequences to the same ZLE actions. Most probably that means
something like this:
bindkey '\e[A' up-line-or-history
bindkey '\e[B' down-line-or-history
bindkey '\e[C' forward-char
bindkey '\e[D' backward-char
bindkey '\eOA' up-line-or-history
bindkey '\eOB' down-line-or-history
bindkey '\eOC' forward-char
bindkey '\eOD' backward-char
If you use the vi keybindings, which it looks as though you might from
your description of the symptoms, then you should use:
bindkey -v
bindkey '\e[A' vi-up-line-or-history
(etc., putting "vi-" into each of the above examples)
Hey, PWS: You might want to mention keypad mode in the FAQ answer 3.8.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: zsh & HP Term
2000-04-28 4:19 ` Bart Schaefer
@ 2000-04-28 12:27 ` Ville Herva
0 siblings, 0 replies; 5+ messages in thread
From: Ville Herva @ 2000-04-28 12:27 UTC (permalink / raw)
To: Bart Schaefer; +Cc: zsh-users
On Fri, Apr 28, 2000 at 04:19:29AM +0000, you [Bart Schaefer] claimed:
> On Apr 27, 11:02am, Ville Herva wrote:
> } Subject: Re: zsh & HP Term
> }
> } Propably not strictly related to zsh, but I'll ask anyway: I'm having a
> } bit different problem with terminal under HPUX 10.20. Most if not all
> } programs I run seem to ruin my terminal settings so that when I return to
> } zsh, arrow keys work no more.
>
> Many terminals have two modes, the "normal" mode and the "keypad" mode.
> The arrow keys often send different character sequences in the different
> modes. What's happening is that your terminal is getting switched from
> one mode to the other and not switched back. This is probably a result
> of a problem with the termcap or terminfo description of your terminal.
Yes I thought so, but I never found better termcap for the HP. I tried
some but with no luck.
> The easiest thing to do is use bindkey to bind both the keypad and normal
> arrow key sequences to the same ZLE actions. Most probably that means
> something like this:
>
> bindkey '\e[A' up-line-or-history
> bindkey '\e[B' down-line-or-history
> bindkey '\e[C' forward-char
> bindkey '\e[D' backward-char
> bindkey '\eOA' up-line-or-history
> bindkey '\eOB' down-line-or-history
> bindkey '\eOC' forward-char
> bindkey '\eOD' backward-char
Marvellous! That solved it. If I had only asked this three years
earlier... Oh well.
> Hey, PWS: You might want to mention keypad mode in the FAQ answer 3.8.
Good idea...
-- v --
v@iki.fi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: zsh & HP Term
2000-03-31 17:16 rodriguez_ruggeberg
@ 2000-04-02 5:20 ` Bart Schaefer
0 siblings, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 2000-04-02 5:20 UTC (permalink / raw)
To: rodriguez_ruggeberg, zsh-users
On Mar 31, 12:16pm, rodriguez_ruggeberg@non.hp.com wrote:
} Subject: zsh & HP Term
}
} I've run into some problems when trying to configure zsh for use with
} an HP Terminal. In essence, I do not seem to be able to map the arrow
} keys to anything.
}
} [...] to my amazement, the program could not pick the arrow keys as
} being pressed! This leads me to believe that either the device for
} the HP term is "swallowing" the arrow keys, or that the system just
} uses a different system to comunicate the arrow keys.
HPTerm terminals date from the days when even direct connections to the
mainframe were at 300 baud and it was important to transmit as little as
possible between the terminal and the host. So the HPTerm has all sorts
of smarts of its own -- all the cursor movement and forms-based data
entry takes place *in the terminal*, and then a whole screenful of it
is sent back at once.
(Next time you're at a login: prompt, start poking the arrow keys. You'll
note that they move the cursor around the screen, even though there's no
program running to drive the display.)
There is some way to get an HP terminal to really send something on every
key press, but I've forgotten how ... I believe the curses library, for
example, set that up when it initializes, but zsh doesn't use curses. It
may be enough to use something like this in your .zshrc:
precmd() { echotc ti }
preexec() { echotc te }
but I don't promise anything ...
Since you appear to actually work for HP, you can probably find somebody
who knows about this stuff.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* zsh & HP Term
@ 2000-03-31 17:16 rodriguez_ruggeberg
2000-04-02 5:20 ` Bart Schaefer
0 siblings, 1 reply; 5+ messages in thread
From: rodriguez_ruggeberg @ 2000-03-31 17:16 UTC (permalink / raw)
To: zsh-users
[-- Attachment #1: BDY.TXT --]
[-- Type: text/plain, Size: 1843 bytes --]
Hi,
I´ve been using zsh with HP-UX for the past two months and I am very impressed
with it. I've succesfully configured my connection through a vt100 terminal to
work just the way I wanted.
However, I've run into some problems when trying to configure zsh for use with
an HP Terminal. In essence, I do not seem to be able to map the arrow keys to
anything. I have read as much documentation on zsh as I could find, yet if the
answer was there, it eluded me.
I even tried the following without success:
bindkey "$(echotc kl)" backward-char
bindkey "$(echotc kr)" forward-char
bindkey "$(echotc ku)" up-line-or-history
bindkey "$(echotc kd)" down-line-or-history
After a while, I decided to write a mini C program to see what kind of values
the HP Term sent when pressing the arrowkeys .. :
#include <stdio.h>
int main(void) {
int c,a;
for(a=0;a<5;a++) {
c=getchar();
printf("c=%d - %c\n",c,c);
}
}
.. and to my amazement, the program could not pick the arrow keys as being
pressed! This leads me to believe that either the device for the HP term is
"swallowing" the arrow keys, or that the system just uses a different system to
comunicate the arrow keys. (maybe the Term sends the current cursor position in
binary or something).
The reason I say the latter is because if I do an export TERM=tty while my
terminal is in HP mode, I still cannot detect any arrow key presses with the
above little hack.
Nontheless, other programs such as HP's own "SAM" (System Administrator Tool)
and others have no problem detecting the arrow keys and using them to select
items, etc.
I really welcome any ideas and suggestions, since I've pretty much run into a
wall here.
Kind Regards,
Alec Rodriguez
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2000-04-28 12:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-27 8:02 zsh & HP Term Ville Herva
2000-04-28 4:19 ` Bart Schaefer
2000-04-28 12:27 ` Ville Herva
-- strict thread matches above, loose matches on Subject: below --
2000-03-31 17:16 rodriguez_ruggeberg
2000-04-02 5:20 ` Bart Schaefer
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).