The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] Job Control and other terminal fun
@ 2023-01-30 16:31 Ron Natalie
  2023-01-30 16:39 ` [TUHS] " Chet Ramey
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ron Natalie @ 2023-01-30 16:31 UTC (permalink / raw)
  To: The Eunuchs Hysterical Society

[-- Attachment #1: Type: text/plain, Size: 3732 bytes --]

A lot of this dates back from the old “tty” days (or at least crt 
terminals that were still alphanumeric).    Even the concept of putting 
a job in the background with & is really a feature of trying to 
multiplex multiple tasks on the same dumb terminal.   This is indeed 
less important with windowing things like the DMDs or modern windowing 
workstatiosn when you can just get another window.    The Berkeley job 
control was an interesting hack.   For us at BRL the problem was I 
absolutely detested the C shell syntax.   The Korn shell hadn’t escaped 
from AT&T yet,  so, I spent time figuring out how that really worked in 
the C shell (not really well documented), mostly by inspection, and then 
reimplemented it in the Bourne Shell (we were using the System V source 
code version for that).    I still couldn’t get traction at BRL for 
using the Bourne shell because by that time, tcsh had come out with 
command line editing.   So back to the shell sources I went.   By this 
time, 5R2 had come out so I grabbed the shell source form that.   I was 
very delighted to find that the macros that made C look sorta like Algol 
had been unwound and the thing was back to straight C.   I reworked 
emacs-ish command line editing into the shell.   Subsequently, I had a 
nice conversation with David Korn at USENIX, being probably at that 
point the two most familiar with Bourne shell job control internals. I 
also sat down with the guys writing either bash or the pdksh (can’t 
remember which) and explained all how this work.  As a result my name 
ended up in the Linux manpages which was pretty much all I found for a 
while when I googled myself.

Years later, I had left the BRL, spent three years as a Rutgers 
administrator and was working for a small startup in Virginia.   There 
was a MIPS workstation there.    I was slogging along using ed (my 
employees always were amazed that if there was no emacs on the system, I 
just used ed, having never learned vi).   Not thinking about it, I 
attempted to retrieve a backgrounded job by typing “fg.”   To my 
surprise the shell printed “Job control not enabled.”   Hmm, I say.  
That sounds like my error message.   “set -J” I type.   “Job control 
enabled.”   Hey! This is my shell.    Turns out Doug Gwyn put my mods 
into his “System V on BSD” distribution tape and it had made its way 
into the Mach code base and so every Mach-derived system ended up with 
it.   Certainly, I found it convenient.

There have been other schemes other than job control to multiplex 
terminals.    IBM in the AIX that ran on the 370/PS2/i860 had a device 
called the High Function Terminal that allowed you to swap screens on 
the console.   When we implemented the i860 (which was an add in card 
for the micro channel), we called our console the Low Function Terminal.

Then after spending some time on MIT’s ITS and TOPS20, I got intrigued 
by the fact on those systems you could have a “shell” that persisted 
across logins and could be detached and reattached on another device at 
another time.    I set about making such an implementation.    Not 
particularly efficient, it essentially grabbed one of the BSD ptys and 
spawned the shell there and then a small alternative login shell 
forwarded the real tty to that.    You could then detach it leaving the 
shell running on the PTY and reattach it elsewhere.    Much like ITS, 
on. login it reminded you that you had a detached shell running and 
offered to reattach it rather than spawning a new one (complete with the 
ITS-ish: space for yes, rubout for no).   It never really caught on.

Oh well, pardon my ramblings.

-Ron

[-- Attachment #2: Type: text/html, Size: 4652 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [TUHS] Re: Job Control and other terminal fun
  2023-01-30 16:31 [TUHS] Job Control and other terminal fun Ron Natalie
@ 2023-01-30 16:39 ` Chet Ramey
  2023-01-30 17:00 ` Ralph Corderoy
  2023-01-31  9:51 ` Lars Brinkhoff
  2 siblings, 0 replies; 5+ messages in thread
From: Chet Ramey @ 2023-01-30 16:39 UTC (permalink / raw)
  To: Ron Natalie, The Eunuchs Hysterical Society

On 1/30/23 11:31 AM, Ron Natalie wrote:

> Years later, I had left the BRL, spent three years as a Rutgers 
> administrator and was working for a small startup in Virginia.   There was 
> a MIPS workstation there.    I was slogging along using ed (my employees 
> always were amazed that if there was no emacs on the system, I just used 
> ed, having never learned vi).   Not thinking about it, I attempted to 
> retrieve a backgrounded job by typing “fg.”   To my surprise the shell 
> printed “Job control not enabled.”   Hmm, I say.  That sounds like my error 
> message.   “set -J” I type.   “Job control enabled.”   Hey! This is my 
> shell.    Turns out Doug Gwyn put my mods into his “System V on BSD” 
> distribution tape and it had made its way into the Mach code base and so 
> every Mach-derived system ended up with it.   Certainly, I found it convenient.

To tie a couple of recent threads together: Ron's shell ended up as /bin/sh
on the NeXT machines.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [TUHS] Re: Job Control and other terminal fun
  2023-01-30 16:31 [TUHS] Job Control and other terminal fun Ron Natalie
  2023-01-30 16:39 ` [TUHS] " Chet Ramey
@ 2023-01-30 17:00 ` Ralph Corderoy
  2023-01-30 21:00   ` Steffen Nurpmeso
  2023-01-31  9:51 ` Lars Brinkhoff
  2 siblings, 1 reply; 5+ messages in thread
From: Ralph Corderoy @ 2023-01-30 17:00 UTC (permalink / raw)
  To: tuhs

Hi Ron,

> IBM in the AIX that ran on the 370/PS2/i860 had a device called the
> High Function Terminal that allowed you to swap screens on the
> console.

The HFT continued on the POWER RS/6000s.

> I got intrigued by the fact on those systems you could have a “shell”
> that persisted across logins and could be detached and reattached on
> another device at another time.  I set about making such an
> implementation.  Not particularly efficient, it essentially grabbed
> one of the BSD ptys and spawned the shell there and then a small
> alternative login shell forwarded the real tty to that.  You could
> then detach it leaving the shell running on the PTY and reattach it
> elsewhere.  Much like ITS, on.  login it reminded you that you had a
> detached shell running and offered to reattach it rather than spawning
> a new one (complete with the ITS-ish: space for yes, rubout for no).
> It never really caught on.

It sounds like what screen(1), byobu(1), tmux(1), etc., do today except
the user normally runs the program from the shell after logging in
though I expect some of them support being chsh'd to being the log-in
shell.

Acorn's RISC iX, their 4.3 BSD launched in ’89 and running on their
ARM2, had what they called ‘virtual terminals’ where the user could
switch to one of several TTYs using the keyboard; getty would be
waiting.  Similar to Linux today.  What early systems had this idea
as a means of multiplexing terminals to a single user?

-- 
Cheers, Ralph.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [TUHS] Re: Job Control and other terminal fun
  2023-01-30 17:00 ` Ralph Corderoy
@ 2023-01-30 21:00   ` Steffen Nurpmeso
  0 siblings, 0 replies; 5+ messages in thread
From: Steffen Nurpmeso @ 2023-01-30 21:00 UTC (permalink / raw)
  To: Ralph Corderoy; +Cc: tuhs

Ralph Corderoy wrote in
 <20230130170028.AFF8C1FB2F@orac.inputplus.co.uk>:
 |> IBM in the AIX that ran on the 370/PS2/i860 had a device called the
 |> High Function Terminal that allowed you to swap screens on the
 |> console.
 ...
 |> I got intrigued by the fact on those systems you could have a “shell”
 |> that persisted across logins and could be detached and reattached on
 |> another device at another time.  I set about making such an
 |> implementation.  Not particularly efficient, it essentially grabbed
 ...
 |It sounds like what screen(1), byobu(1), tmux(1), etc., do today except

To mention dtach(1) which only "emulates the detach feature of
screen".  (I use it on the vserver to run an ip(8) netns /
unshare(1) etc boxed irssi proxy that serves to the inside VPN.
Flawless for many years.)

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [TUHS] Re: Job Control and other terminal fun
  2023-01-30 16:31 [TUHS] Job Control and other terminal fun Ron Natalie
  2023-01-30 16:39 ` [TUHS] " Chet Ramey
  2023-01-30 17:00 ` Ralph Corderoy
@ 2023-01-31  9:51 ` Lars Brinkhoff
  2 siblings, 0 replies; 5+ messages in thread
From: Lars Brinkhoff @ 2023-01-31  9:51 UTC (permalink / raw)
  To: Ron Natalie; +Cc: The Eunuchs Hysterical Society

Ron Natalie wrote:
> The Berkeley job control was an interesting hack.

Just to add some historical context, Berkeley job control was added by
James Kulp.  He had previously used ITS and copied those features pretty
much as-is: ^Z does the same thing; bg and fg are named differently but
work the same.

> A lot of this dates back from the old “tty” days (or at least crt
> terminals that were still alphanumeric).  Even the concept of putting
> a job in the background with & is really a feature of trying to
> multiplex multiple tasks on the same dumb terminal.

Indeed ITS got started in 1967 with users interacting through teletypes.
Later CRT terminals were added, but the terse user interface persisted.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-01-31  9:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-30 16:31 [TUHS] Job Control and other terminal fun Ron Natalie
2023-01-30 16:39 ` [TUHS] " Chet Ramey
2023-01-30 17:00 ` Ralph Corderoy
2023-01-30 21:00   ` Steffen Nurpmeso
2023-01-31  9:51 ` Lars Brinkhoff

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).