Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Terminal issues

28 views
Skip to first unread message

Steven Hirsch

unread,
Dec 30, 2011, 11:15:38 PM12/30/11
to
No, I'm not terminal, but I've been fighting with z80pack all evening trying
to get a Linux terminal emulation that cooperates with programs running under
CP/M.

I start the session inside of 'wy60', which is a Wyse-60 emulation (easier to
configure CP/M apps for that as opposed to VT100/xterm). Almost everything is
working correctly except for one thing: Inside an application (e.g. WordStar
or any other editor), BS, Ctrl-H and Del all produce a non-destructive
backspace! At the command line, they work correctly.

Does anyone have an idea why this is happening?

Steve

Roger Ivie

unread,
Dec 31, 2011, 1:22:21 AM12/31/11
to
On 2011-12-31, Steven Hirsch <snhi...@gmail.com> wrote:
> I start the session inside of 'wy60', which is a Wyse-60 emulation
> (easier to configure CP/M apps for that as opposed to VT100/xterm).
> Almost everything is working correctly except for one thing: Inside
> an application (e.g. WordStar or any other editor), BS, Ctrl-H and
> Del all produce a non-destructive backspace! At the command line,
> they work correctly.
>
> Does anyone have an idea why this is happening?

I am a bit curious about what you mean by "at the command line, they
work properly". If you're talking about stock CP/M 2, pressing delete
should echo the character deleted whereas ^H will cause it to be
erased from the screen (i.e., behave like most everything else and
therefore likely to be thought of as "working properly"). There is
a patch running around that causes CP/M to treat ^H the same as
delete, but the vanilla install doesn't.

My guess would be that your keyboard map has the backspace and delete
keys configured to send ^H. Having the backspace key so configured is
not unusual, but I think having the delete key also so configured is.

I fear you're going to have to read up on xmodmap. I don't do much X
windows work anymore, and I was pretty fuzzy on xmodmap to start with,
so I can't give you much help.

One thing I do expect, however, is that once you get it mapped correctly
for wy60 and z80pack, it's going to be wrong for everything else. Then
you'll get to read up on "stty dec".
--
roger ivie
ri...@ridgenet.net

Steven Hirsch

unread,
Dec 31, 2011, 7:06:23 PM12/31/11
to
On 12/31/2011 01:22 AM, Roger Ivie wrote:
> On 2011-12-31, Steven Hirsch<snhi...@gmail.com> wrote:
>> I start the session inside of 'wy60', which is a Wyse-60 emulation
>> (easier to configure CP/M apps for that as opposed to VT100/xterm).
>> Almost everything is working correctly except for one thing: Inside
>> an application (e.g. WordStar or any other editor), BS, Ctrl-H and
>> Del all produce a non-destructive backspace! At the command line,
>> they work correctly.
>>
>> Does anyone have an idea why this is happening?
>
> I am a bit curious about what you mean by "at the command line, they
> work properly". If you're talking about stock CP/M 2, pressing delete
> should echo the character deleted whereas ^H will cause it to be
> erased from the screen (i.e., behave like most everything else and
> therefore likely to be thought of as "working properly"). There is
> a patch running around that causes CP/M to treat ^H the same as
> delete, but the vanilla install doesn't.

I left out a critical fact: This is an NZCOM environment with sane command
line behavior. Ctrl-H is a destructive backspace at the CP/M prompt, but not
when in an application like Wordstar.

> My guess would be that your keyboard map has the backspace and delete
> keys configured to send ^H. Having the backspace key so configured is
> not unusual, but I think having the delete key also so configured is.

Right, but that shouldn't matter since they DO work correctly in the emulator
when I'm sitting at the A> prompt.

> I fear you're going to have to read up on xmodmap. I don't do much X
> windows work anymore, and I was pretty fuzzy on xmodmap to start with,
> so I can't give you much help.

As a workaround, I remapped the Delete key to Ctrl-H, Ctrl-G and, as long as I
remember to use it, that works properly inside applications. I think some
debugging of the z80pack simulator will be required to understand what's going
on. I'm thinking of inserting a small piece of code to write the console
output stream to a file. After a few quick checks inside and outside the
application, I'll take a look through it and see if the CP/M app is munging
the terminal control strings.

> One thing I do expect, however, is that once you get it mapped correctly
> for wy60 and z80pack, it's going to be wrong for everything else. Then
> you'll get to read up on "stty dec".

If I was planning to make this a global change, then yes. However this
environment is specific to running the emulator and is setup with a shell
script for that purpose. Won't affect anything else on the box.

Steve

Roger Ivie

unread,
Dec 31, 2011, 7:39:11 PM12/31/11
to
On 2012-01-01, Steven Hirsch <snhi...@gmail.com> wrote:
> I left out a critical fact: This is an NZCOM environment with sane command
> line behavior. Ctrl-H is a destructive backspace at the CP/M prompt, but not
> when in an application like Wordstar.

According to the patch notes for MS-DOS WordStar 4.0 that I have lying
around, there's a flag named CTLHFL that controls whether ^H is treated
as ^S or DEL. It's recognized by the CP/M WS4.0 WSCHANGE program; it
looks like it defaults to 0 (i.e., WSU.COM has it zero), which means ^H
is supposed to act as DEL.

I don't have older versions of WordStar lying around. You might try
firing up WSCHANGE and seeing how it's set.
--
roger ivie
ri...@ridgenet.net

Steven Hirsch

unread,
Jan 1, 2012, 11:02:46 PM1/1/12
to
Ah, thanks very much for that bit of information! I suspect the Z-System
utils are doing something very similar.

Ivan Shmakov

unread,
Jan 22, 2012, 6:15:58 AM1/22/12
to
>>>>> Roger Ivie <ri...@ridgenet.net> writes:
>>>>> On 2011-12-31, Steven Hirsch <snhi...@gmail.com> wrote:

[Cross-posting to news:alt.os.linux, as this seems like an issue
with XTerm.]

>> I start the session inside of 'wy60', which is a Wyse-60 emulation
>> (easier to configure CP/M apps for that as opposed to VT100/xterm).
>> Almost everything is working correctly except for one thing: Inside
>> an application (e.g. WordStar or any other editor), BS, Ctrl-H and
>> Del all produce a non-destructive backspace! At the command line,
>> they work correctly.

>> Does anyone have an idea why this is happening?

> I am a bit curious about what you mean by "at the command line, they
> work properly". If you're talking about stock CP/M 2, pressing delete
> should echo the character deleted whereas ^H will cause it to be
> erased from the screen (i.e., behave like most everything else and
> therefore likely to be thought of as "working properly"). There is a
> patch running around that causes CP/M to treat ^H the same as delete,
> but the vanilla install doesn't.

> My guess would be that your keyboard map has the backspace and delete
> keys configured to send ^H. Having the backspace key so configured is
> not unusual,

Nevertheless, the “preferred” GNU (and GNU/Linux) backspace is
ASCII DEL (AKA ^?, ^8, \x7f), though, somewhat surprising, XTerm
is often configured contrary to this convention.

> but I think having the delete key also so configured is.

Also note that XTerm does a mapping of its own:

--cut: xterm(1) --
backarrowKey (class BackarrowKey)
Specifies whether the backarrow key transmits a
backspace (8) or delete (127) character. This
corresponds to the DECBKM control sequence. The
default (backspace) is ``true.'' Pressing the
control key toggles this behavior.
--cut: xterm(1) --

This behavior could also be toggled with XTerm menu's “Backarrow
Key (BS/DEL) (backarrow key)” option (Ctrl+LeftMouseButton,
IIRC), or, I believe, by editing the resource with editres(1).

[…]

--
FSF associate member #7257

Steven Hirsch

unread,
Jan 22, 2012, 10:22:12 AM1/22/12
to
On 01/22/2012 06:15 AM, Ivan Shmakov wrote:
> Nevertheless, the “preferred” GNU (and GNU/Linux) backspace is
> ASCII DEL (AKA ^?, ^8, \x7f), though, somewhat surprising, XTerm
> is often configured contrary to this convention.
>
> > but I think having the delete key also so configured is.
>
> Also note that XTerm does a mapping of its own:
>
> --cut: xterm(1) --
> backarrowKey (class BackarrowKey)
> Specifies whether the backarrow key transmits a
> backspace (8) or delete (127) character. This
> corresponds to the DECBKM control sequence. The
> default (backspace) is ``true.'' Pressing the
> control key toggles this behavior.
> --cut: xterm(1) --
>
> This behavior could also be toggled with XTerm menu's “Backarrow
> Key (BS/DEL) (backarrow key)” option (Ctrl+LeftMouseButton,
> IIRC), or, I believe, by editing the resource with editres(1).

Thanks, Ivan.

I eventually found a ZCPR3 termcap for DEC terminals that appears to work
correctly with xterm in its default configuration.

Steve
0 new messages