Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -487,10 +487,13 @@ @sed -e 's#^build =.*#build = "@ABSPREFIX@"#' \ -e 's#^media =.*#media = os.path.join (build, "share/media/")#' \ -e 's#^os8mo =.*#os8mo = os8mi#' \ < $(PIDP8I_DIRS) > @prefix@/$(PIDP8I_DIRS) @chgrp @INSTGRP@ @prefix@/$(PIDP8I_DIRS) + + @# We need a directory for PIDs and such in some cases + @@INSTALL@ -d -m 755 @prefix@/run instdirs: @echo "Creating installation directory tree..." @for d in $(INSTDIRS) ; do @INSTALL@ -m 755 -o @INSTUSR@ -g @INSTGRP@ -d @prefix@/$$d ; done Index: README.md ================================================================== --- README.md +++ README.md @@ -759,10 +759,33 @@ * **screen**: The default, per above. * [**tmux**][tmux]: A popular alternative to `screen`, especially on BSD platforms. + +* [**`dtach`**][dtach]: A minimalist alternative to `screen` which + provides only its terminal attach/detach features. + + In addition to the virtues called out on the program’s home page, + use of this option has a side benefit for some PiDP-8/I users: + `screen` and `tmux` assume an [ANSI X3.64 terminal][ansit] (e.g. DEC + VT102 or xterm), because they interpret escape codes to provide + features such as their scrollback buffer. It is uncommon to find + PDP-8 software that uses ANSI terminal escape codes since almost all + PDP-8 computers sold predate that standard. Most PDP-8 software + assumes a dumb teletypewriter, and of the software that does make + use of a smart terminal, there’s a good chance it wants something + else, such as a [Tek 4010][t4010] series terminal. These ANSI screen + managers can therefore get in the way and mess things up. + + `dtach` doesn’t interfere with terminal escape code handling; thus + this option. + + Unlike `screen` and `tmux`, there is no command layer enetered + via an "attention" keystroke in `dtach`. The only key that `dtach` + scans for from the terminal is the detach keystroke, which we leave + at its default, Ctrl-\\. * **none**: This mode is for interactive use, allowing you to run the installed simulator with the installed media without any screen manager at all. @@ -780,12 +803,15 @@ $ sudo apt install tmux Switching between configured screen managers must be done while the simulator is stopped. +[ansit]: https://en.wikipedia.org/wiki/ANSI_escape_code +[dtach]: https://github.com/crigler/dtach [gscr]: https://www.gnu.org/software/screen/ [scons]: /wiki?name=Serial+or+Telnet+PDP-8+Console +[t4010]: https://en.wikipedia.org/wiki/Tektronix_4010 [tmux]: https://tmux.github.io/ ## The OS/8 RK05 Disk Image Index: bin/pidp8i.in ================================================================== --- bin/pidp8i.in +++ bin/pidp8i.in @@ -34,10 +34,11 @@ prefix="@ABSPREFIX@" sim="$prefix/bin/pidp8i-sim" scanswitch="$prefix/libexec/scanswitch" systemctl=$(uname -r | grep -qw Microsoft && echo /bin/nothing || echo /bin/systemctl) ggrep=$(which ggrep grep 2> /dev/null | head -1) +dtsock=$prefix/run/pidp8i-dtach.sock if [ -e "$prefix/etc/pidp8i.rc" ] then . "$prefix/etc/pidp8i.rc" fi @@ -53,10 +54,13 @@ then return 1 elif [ "$SCREEN_MANAGER" = "tmux" ] then tmux has-session -t pidp8i 2>/dev/null + elif [ "$SCREEN_MANAGER" = "dtach" ] + then + test -e $dtsock else procs=`screen -list pidp8i | $ggrep -Pc '\d\.pidp8i'` test -n "$procs" && test $procs -gt 0 && return 0 || return 1 fi } @@ -66,10 +70,13 @@ then echo "" elif [ "$SCREEN_MANAGER" = "tmux" ] then tmux list-sessions -F '#{session_name} #{pid}' | awk '/^pidp8i / {print $2}' + elif [ "$SCREEN_MANAGER" = "dtach" ] + then + test -e $dtsock && fuser -f $dtsock | cut -f2 -d' ' else screen -ls pidp8i | grep -Eo '[[:digit:]]+\.pidp8i' | grep -Eo '^[[:digit:]]+' fi } @@ -84,10 +91,13 @@ then echo Joining simulator session already in progress... if [ "$SCREEN_MANAGER" = "tmux" ] then exec tmux attach-session -d -t pidp8i + elif [ "$SCREEN_MANAGER" = "dtach" ] + then + exec dtach -a $dtsock else exec screen -r -S pidp8i fi else cat <