[TUHS] Literal character escapes in v7

Dennis Boone drb at msu.edu
Tue Nov 7 19:07:23 AEST 2017


 > I'm not looking for code review, but the code is intended to replace
 > the tabs and backspaces with \t and \b respectively, but I haven't
 > been able to test it because I can't seem to make a backspace
 > character appear in input. In later unices, ^V followed by the
 > backspace would work, but that's not part of v7. Backspace itself is
 > my erase character, so anytime I just type it, it backspaces :).

This bit from the middle of sys/dev/tty.c seems to indicate that you
escape it with \:

	} else {
		mc = maptab[c];
		if (c==tp->t_erase || c==tp->t_kill)
			mc = c;
		if (mc && (mc==c || (tp->t_flags&LCASE))) {
			if (bp[-2] != '\\')
			c = mc;
			bp--;
		}
	}

On my test v7 system if I type backslash control-h:

	# stty
	speed 0 baud
	erase = '^H'; kill = '^U'
	even -nl echo -tabs
	# echo \^H | od -c
	0000000  \b  \n
	0000002
	#

De


More information about the TUHS mailing list