This is a text-only version of the following page on https://raymii.org:
---
Title : Backspace and delete key behaviour on OpenVMS
Author : Remy van Elst
Date : 09-04-2018
URL : https://raymii.org/s/blog/Backspace_and_delete_key_behaviour_on_OpenVMS.html
Format : Markdown/HTML
---
[![openvms][1]][2]
(You can read all my OpenVMS articles by [clicking the picture above][2])
While working on the [DECUServe OpenVMS][3] system I found out quickly that
pressing BACKSPACE moves the cursor on the shell to the beginning of the line
instead of deleting the character to the left of the cursor. This made me very
aware of my typing, since when I made an error I had to retype the entire line
(the terminal is in insert mode it seems). After reading through some
documentation it seems that is default behaviour but there are terminal options
to change it.
Recently I removed all Google Ads from this site due to their invasive tracking, as well as Google Analytics. Please, if you found this content useful, consider a small donation using any of the options below:
I'm developing an open source monitoring app called Leaf Node Monitoring, for windows, linux & android. Go check it out!
Consider sponsoring me on Github. It means the world to me if you show your appreciation and you'll help pay the server costs.
You can also sponsor me by getting a Digital Ocean VPS. With this referral link you'll get $100 credit for 60 days.
### DCL (shell)
OpenVMS uses the DCL shell, short for Digital Command Language. It appears that
DCL is an attempt to have one shell for all systems of DEC, so that one only has
to learn one shell environment usable on many systems.
I use SSH to connect to the [DECUServe system][3] and doing that from a linux
computer I had no problem with backspace. As in, the backspace key removes the
character left of the cursor.
From a windows system with Putty for SSH, I noticed that the Backspace key moves
the cursor to the beginning of the line. The terminal is set on insert mode, so
I had to retype the entire line when making a typo. The delete key was also of
no help, it didn't seems to do anything.
Since I often work with network devices such as switched, I resorted to the
famous `CTRL+H` key combo. That also moved the cursor to the start of the line.
I was hoping it would remove a character.
### Terminal input features
The first clue came when I read [this documentation][5] on shell features such
as go to the end or beginning of a line. Like `CTRL+A` and `CTRL+E` in bash
emacs mode (default).
To correct a typo when the shell is in BACKSPACE to the start of the line mode,
I used the `CTRL+J` key combo. That deletes an entire word. So I pressed
backspace, ended up at the start of the line and either using the arrow keys or
`CTRL+E` (go to the end of the line) I went back to the typo and pressed
`CTRL+J` to remove the word and redo the typo.
I also found out that the DCL by default is in overwrite (insert) mode. Thas
means that when you move the cursor to a place in a word and start typing, the
character underneath the cursor is overwritten. The alternative (append mode)
means that the characters are placed before the character under the cursor and
nothing is overwritten.
To switch these modes in the DCL shell, use `CTRL+A`. I was unable to find a
visual indicator to show which mode you are in. This combo also works in the
`EVE` editor by the way.
Not an optimal situation to be in regarding typing. It is quite cumbersome when
you are used to certain backspace key behaviour.
### SET TERMINAL
Reading [more documentation][6] on terminal options I found the specific option
I was looking for:
/BACKSPACE=keyword
Controls how the system responds to the backspace key (Ctrl/H) in line editing mode. There are two possible keywords:
BACKSPACE (default) --- The terminal driver returns the user to the beginning of the line. (This is the traditional way OpenVMS has always worked.)
DELETE --- The terminal driver interprets the backspace key as a delete character instruction.
Note the following exceptions:
If the terminal is set in PASSALL or PASTHRU mode, the backspace key is not interpreted as a delete character instruction.
If the user issues an IO$_READVBLK with IO$M_NOFILTR or IO$_READPBLK, the backspace key is not interpreted as a delete character instruction.
You can use SYSGEN to make /BACKSPACE=DELETE the default for all terminals by setting the system parameter TTY_DEFCHAR3 to 16.
If the default is set to DELETE, the user can still go to the start of a line by pressing F12 or by entering the following sequence: Ctrl/V Ctrl/H Ctrl/H.
So using the following command one can make their backspace key remove a
character left of the cursor:
$ SET TERMINAL /BACKSPACE=DELETE
After which to my pleasure, the backspace key works as I want it to work. Even
in `EVE`, the editor.
### Make it last
I want this to be my default and on linux I'm used to placing stuff in the
`.bashrc` or `.profile` to be executed at every shell login. OpenVMS has such a
thing, namely `LOGIN.COM` in your home folder.
On the DECUS system there already was stuff in there, so I only added my line on
the most logical place. This is the specific line:
$ SET TERMINAL /BACKSPACE=DELETE
Using the EVE editor:
EVE LOGIN.COM
This is the complete file with my changes:
$! Template login.com procedure for DECUServe users.
$ set noon
$ ! Remove the following line if you want to use DECWindows Notes
$ NO*TES :== NOTES/INTERFACE=CHARACTER_CELL
$ if f$mode() .nes. "INTERACTIVE" then goto end_interactive
$ ! Place commands to be executed only in interactive mode here:
$ set terminal/inquire/noeightbit
$ update_notebook ! Spawned update of the MAIN class in your Notebook.
$end_interactive:
$ ! Place commands to be executed in all modes here:
$ show quota
$ SET TERMINAL /BACKSPACE=DELETE
$ exit
Saving it with `CTRL+Z`, then logging out (with `LOG`) and logging back in, my
backspace key now always is just the way I like it.
[1]: https://raymii.org/s/inc/img/ovmsdec.png
[2]: https://raymii.org/s/tags/openvms.html
[3]: http://decus.org
[4]: https://www.digitalocean.com/?refcode=7435ae6b8212
[5]: https://web.archive.org/web/20180408095639/http://h41379.www4.hpe.com/doc/84final/ba554_90018/ch05s01.html
[6]: https://web.archive.org/web/20180408100057/http://h41379.www4.hpe.com/doc/84final/9996/9996pro_222.html
---
License:
All the text on this website is free as in freedom unless stated otherwise.
This means you can use it in any way you want, you can copy it, change it
the way you like and republish it, as long as you release the (modified)
content under the same license to give others the same freedoms you've got
and place my name and a link to this site with the article as source.
This site uses Google Analytics for statistics and Google Adwords for
advertisements. You are tracked and Google knows everything about you.
Use an adblocker like ublock-origin if you don't want it.
All the code on this website is licensed under the GNU GPL v3 license
unless already licensed under a license which does not allows this form
of licensing or if another license is stated on that page / in that software:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Just to be clear, the information on this website is for meant for educational
purposes and you use it at your own risk. I do not take responsibility if you
screw something up. Use common sense, do not 'rm -rf /' as root for example.
If you have any questions then do not hesitate to contact me.
See https://raymii.org/s/static/About.html for details.