Discussion:
F6 and ctrl-C
Add Reply
Jan-Erik Söderholm
2021-07-08 23:37:08 UTC
Reply
Permalink
Hi.

Maybe a silly question...

It seems as PF6 and PF10 are linked to Ctrl/C and Ctrl/Z.
At least as it says in the OpenVMS User Manual:

Ctrl/Z and F10 Signals the end of the file for data entered from the terminal.

Ctrl/Y, Ctrl/C and F6 Interrupts command processing. You can disable
Ctrl/Y with the command SET NOCONTROL=Y.


I have found different ways to disable Ctrl/Y and Ctrl/T, but
what about Ctrl/C? We are looking at replacing our old screen
mgr tool (that doesn't support the 132 mode that we need) with
the built-in SCREEN and DISPLAY exensions in Cobol.

But currently, pressing PF6 just prints the usual "Interrupt"
and exists the application. How to prevent that and let the
PF6 codes through to the application?

Doing SET NOCONT=Y still displays "Interrupt", but it doesn't exit
the app. Setting the account to /flags=restricted does the same.

I want to have PF6 available as a function key in the application...

And also, I do not seem to get the ESC codes 11~ to 14~ through.
They comes from the F1-F4 och the PC keyboard...

Any ideas?

Jan-Erik.
Stephen Hoffman
2021-07-09 00:12:57 UTC
Reply
Permalink
Post by Jan-Erik Söderholm
I want to have PF6 available as a function key in the application...
F6 sends its expected function key control sequence, and the terminal
driver intercepts and converts that to ^C, and SET TERMINAL
/NOLINE_EDIT is one way to disable that driver conversion.

I don't recall if there's a (more) targeted means to disable (just) F6
conversion within the terminal driver itself, short of patching the
driver or such, and, yes, /NOLINE_EDIT is a fairly large hammer.

Or tweak the terminal emulator to send something other than (in eight
bit) CSI 1 7.
Post by Jan-Erik Söderholm
And also, I do not seem to get the ESC codes 11~ to 14~ through.
They comes from the F1-F4 och the PC keyboard...
VT terminals treat the first clump of DEC OpenVMS LK-layout function
keys as local, so most of OpenVMS tends not to expect to ever see F1,
F2, F3, F4, or F5.
Post by Jan-Erik Söderholm
Any ideas?
For some of the usual code for fielding ^C and ^Y, see:
https://www.digiater.nl/openvms/freeware/v80/hoffman_examples/lib$xxable_ctrl.c
--
Pure Personal Opinion | HoffmanLabs LLC
Jan-Erik Söderholm
2021-07-09 08:57:30 UTC
Reply
Permalink
Post by Stephen Hoffman
Post by Jan-Erik Söderholm
I want to have PF6 available as a function key in the application...
F6 sends its expected function key control sequence, and the terminal
driver intercepts and converts that to ^C, and SET TERMINAL /NOLINE_EDIT is
one way to disable that driver conversion.
I don't recall if there's a (more) targeted means to disable (just) F6
conversion within the terminal driver itself, short of patching the driver
or such, and, yes, /NOLINE_EDIT is a fairly large hammer.
Or tweak the terminal emulator to send something other than (in eight bit)
CSI 1 7.
Post by Jan-Erik Söderholm
And also, I do not seem to get the ESC codes 11~ to 14~ through.
They comes from the F1-F4 och the PC keyboard...
VT terminals treat the first clump of DEC OpenVMS LK-layout function keys
as local, so most of OpenVMS tends not to expect to ever see F1, F2, F3,
F4, or F5.
Post by Jan-Erik Söderholm
Any ideas?
https://www.digiater.nl/openvms/freeware/v80/hoffman_examples/lib$xxable_ctrl.c
Thanks! In todays application we use a customer unique DEC-written
screen tool (in Fortran). We do have the sources so we might search
it and see if it does something special.

It might very well be that it does some setup against the term driver.

We are rewriting one application from 80 to 132 chars, and that old
DEC tool does not support anything but 80 chars.

We can of course rewrite it to not use F1-F4 at all. These are today
used as "one line down/up" and "one screen forward/back". But that
can also be done with the "arrow down/up" and "page down/up" keys
from a modern kayboard. That has already been tested.
Post by Stephen Hoffman
Can you be more specific on how you're handling the terminal I/O
The "user" just logs in as usual (happens to be telnet here), then
just RUN the EXE that is the application. So all I/O is done through
terminal driver and the usual sys$input and sys$output from Cobol.
Cobol uses DISPLAY and ACCEPT together with the features to SCREEN's
within the DATA DEFINITION section. Quite neat, actually...

I can see the ESC sequences from F1-F4 on the network [11~ to [14~
but they are for some unknown reason never seen by the Cobol code.
It is exactly the same network format as the other like [18~ for F7.
Dave Froble
2021-07-09 00:39:36 UTC
Reply
Permalink
Post by Jan-Erik Söderholm
Hi.
Maybe a silly question...
It seems as PF6 and PF10 are linked to Ctrl/C and Ctrl/Z.
Ctrl/Z and F10 Signals the end of the file for data entered from the terminal.
Ctrl/Y, Ctrl/C and F6 Interrupts command processing. You can disable
Ctrl/Y with the command SET NOCONTROL=Y.
Basic allows ^C to be trapped and handled in a program. Perhaps Cobol
also has this capability.

As Steve sometimes mentions, terse questions beget terse answers. Can
you be more specific on how you're handling the terminal I/O ?
--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: ***@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486
Joukj
2021-07-09 06:35:44 UTC
Reply
Permalink
Post by Dave Froble
Post by Jan-Erik Söderholm
Hi.
Maybe a silly question...
It seems as PF6 and PF10 are linked to Ctrl/C and Ctrl/Z.
Ctrl/Z and F10 Signals the end of the file for data entered from the terminal.
Ctrl/Y, Ctrl/C and F6 Interrupts command processing. You can disable
Ctrl/Y with the command SET NOCONTROL=Y.
Basic allows ^C to be trapped and handled in a program. Perhaps Cobol
also has this capability.
As Steve sometimes mentions, terse questions beget terse answers. Can
you be more specific on how you're handling the terminal I/O ?
All languages should be able to do it by a call to sys$qiow
Arne Vajhøj
2021-07-09 12:59:55 UTC
Reply
Permalink
Post by Joukj
Post by Jan-Erik Söderholm
It seems as PF6 and PF10 are linked to Ctrl/C and Ctrl/Z.
Ctrl/Z and F10 Signals the end of the file for data entered from the terminal.
Ctrl/Y, Ctrl/C and F6 Interrupts command processing. You can disable
Ctrl/Y with the command SET NOCONTROL=Y.
Basic allows ^C to be trapped and handled in a program.  Perhaps Cobol
also has this capability.
As Steve sometimes mentions, terse questions beget terse answers.  Can
you be more specific on how you're handling the terminal I/O ?
All languages should be able to do it by a call to sys$qiow
lib$disable_ctrl and sys$qiow with IO$_SETMODE|IO$M_CTRLCAST|IO$M_CTRLYAST ?

Arne
Jan-Erik Söderholm
2021-07-09 15:03:01 UTC
Reply
Permalink
Post by Arne Vajhøj
Post by Joukj
Post by Jan-Erik Söderholm
It seems as PF6 and PF10 are linked to Ctrl/C and Ctrl/Z.
Ctrl/Z and F10 Signals the end of the file for data entered from the terminal.
Ctrl/Y, Ctrl/C and F6 Interrupts command processing. You can disable
Ctrl/Y with the command SET NOCONTROL=Y.
Basic allows ^C to be trapped and handled in a program.  Perhaps Cobol
also has this capability.
As Steve sometimes mentions, terse questions beget terse answers.  Can
you be more specific on how you're handling the terminal I/O ?
All languages should be able to do it by a call to sys$qiow
lib$disable_ctrl and sys$qiow with IO$_SETMODE|IO$M_CTRLCAST|IO$M_CTRLYAST ?
Arne
I think that we made a quick solution by running the application
from a short COM file where we do a few set term commands...
It works "good enough" for now...

Thanks everyone for your comments.

Jan-Erik.
Joukj
2021-07-12 13:41:12 UTC
Reply
Permalink
Post by Arne Vajhøj
Post by Joukj
Post by Dave Froble
Post by Jan-Erik Söderholm
It seems as PF6 and PF10 are linked to Ctrl/C and Ctrl/Z.
Ctrl/Z and F10 Signals the end of the file for data entered from the terminal.
Ctrl/Y, Ctrl/C and F6 Interrupts command processing. You can disable
Ctrl/Y with the command SET NOCONTROL=Y.
Basic allows ^C to be trapped and handled in a program. Perhaps
Cobol also has this capability.
As Steve sometimes mentions, terse questions beget terse answers.
Can you be more specific on how you're handling the terminal I/O ?
All languages should be able to do it by a call to sys$qiow
lib$disable_ctrl and sys$qiow with
IO$_SETMODE|IO$M_CTRLCAST|IO$M_CTRLYAST ?
Arne
I used only sys$qiow to catch CTRL-C and run my own handler.(see fortran
code I wrote over 30 years ago)

include '($iodef)/list'
structure /iostat_block/
integer*2 iostat
end structure
record /iostat_block/ iosb
!
integer status , code
integer*2 input_chan
!
integer ( kind = kind_i4 ) , external :: sys$assign , sys$qiow
!
! the handler routine
external ctrlc_ast
!
status = sys$assign( 'sys$input' , input_chan , , )
code = io$_setmode .or. io$m_ctrlcast
status = sys$qiow( , %val( input_chan ) , %val( code ) ,iosb &
, , , &
ctrlc_ast , , , , , )
if(.not. status) call lib$signal(%val(status))
if(.not.iosb.iostat) call lib$signal(%val(iosb.iostat))



Jouk
Arne Vajhøj
2021-07-17 00:49:51 UTC
Reply
Permalink
Post by Joukj
Post by Arne Vajhøj
Post by Joukj
Post by Jan-Erik Söderholm
It seems as PF6 and PF10 are linked to Ctrl/C and Ctrl/Z.
Ctrl/Z and F10 Signals the end of the file for data entered from the terminal.
Ctrl/Y, Ctrl/C and F6 Interrupts command processing. You can disable
Ctrl/Y with the command SET NOCONTROL=Y.
Basic allows ^C to be trapped and handled in a program.  Perhaps
Cobol also has this capability.
As Steve sometimes mentions, terse questions beget terse answers.
Can you be more specific on how you're handling the terminal I/O ?
All languages should be able to do it by a call to sys$qiow
lib$disable_ctrl and sys$qiow with
IO$_SETMODE|IO$M_CTRLCAST|IO$M_CTRLYAST ?
I used only sys$qiow to catch CTRL-C and run my own handler.(see fortran
code I wrote over 30 years ago)
      include '($iodef)/list'
      structure /iostat_block/
        integer*2 iostat
      end structure
      record /iostat_block/ iosb
!
      integer status , code
      integer*2 input_chan
!
      integer ( kind = kind_i4 ) , external :: sys$assign , sys$qiow
!
! the handler routine
      external ctrlc_ast
!
      status = sys$assign( 'sys$input' , input_chan , , )
      code = io$_setmode .or. io$m_ctrlcast
      status = sys$qiow( , %val( input_chan ) , %val( code ) ,iosb &
             , , , &
             ctrlc_ast , , , , , )
      if(.not. status) call lib$signal(%val(status))
      if(.not.iosb.iostat) call lib$signal(%val(iosb.iostat))
lib$disable_ctrl is only needed for CTRL/Y - it is not
needed for CTRL/C.

Arne

Loading...