Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD: pty.sh fail: POSIX sh 101(C) #44

Closed
McDutchie opened this issue Jun 26, 2020 · 3 comments
Closed

FreeBSD: pty.sh fail: POSIX sh 101(C) #44

McDutchie opened this issue Jun 26, 2020 · 3 comments
Labels
help wanted Extra attention is needed regressfail Regression test failure

Comments

@McDutchie
Copy link

McDutchie commented Jun 26, 2020

On this system:

$ uname -vm
FreeBSD 12.1-RELEASE-p6 GENERIC  amd64

The following regression test failure occurs:

        pty.sh[291]: POSIX sh 101(C): line 323: expected "^backslash-erase=:\r?\n$", got EOF

The test in question:

tst $LINENO <<"!"
L POSIX sh 101(C)
# If the User Portability Utilities Option is supported and shell
# command line editing is supported: When in insert mode a control-V
# causes the next character to be inserted even in the case that the
# character is a special insert mode character.
# Testing Requirements: The assertion must be tested with at least the
# following set of characters: <newline>, erase, interrupt, kill,
# control-V, control-W, end-of-file, backslash \ (followed by erase or
# kill) and <ESC>.
d 10
p :test-1:
w stty erase ^H intr ^C kill ^X
p :test-2:
w echo erase=:\cV\cH:
u ^erase=:\r?\n$
p :test-3:
w echo kill=:\cV\cX:
u ^kill=:\cX:\r?\n$
p :test-4:
w echo control-V=:\cV\cV:
u ^control-V=:\cV:\r?\n$
p :test-5:
w echo control-W:\cV\cW:
u ^control-W:\cW:\r?\n$
p :test-6:
w echo EOF=:\cV\cD:
u ^EOF=:\004:\r?\n$
p :test-7:
w echo backslash-erase=:\\\cH:
u ^backslash-erase=:\r?\n$
p :test-8:
w echo backslash-kill=:\\\cX:
u ^backslash-kill=:\cX:\r?\n$
p :test-9:
w echo ESC=:\cV\E:
u ^ESC=:\E:\r?\n$
p :test-10:
w echo interrupt=:\cV\cC:
u ^interrupt=:\cC:\r?\n$
!

@McDutchie McDutchie added regressfail Regression test failure help wanted Extra attention is needed labels Jun 26, 2020
@McDutchie McDutchie changed the title FreeBSD regress test fail: pty.sh: POSIX sh 101(C) FreeBSD: pty.sh: POSIX sh 101(C) Jun 26, 2020
@McDutchie McDutchie changed the title FreeBSD: pty.sh: POSIX sh 101(C) FreeBSD: pty.sh fail: POSIX sh 101(C) Jun 26, 2020
@JohnoKing
Copy link

JohnoKing commented Jun 26, 2020

The test always fails in vi mode or when there isn't an editing mode enabled, but it will pass in emacs mode. Placing the following line at the start of the regression test allows it to pass:

w set -o emacs

Replacing set -o emacs with set -o vi or set +o vi; set +o emacs causes the test failure to occur on Linux as well.

@JohnoKing
Copy link

JohnoKing commented Jul 2, 2020

The regression test that fails is testing the escaping backslash feature (see ksh-community/ksh#8 (comment) for what it does). If escaping backslashes are disabled with a patch (like the one appended below) the test will always fail on Linux.

ksh93-escbackslash.patch.txt

@McDutchie
Copy link
Author

McDutchie commented Jul 13, 2020

Thanks, @JohnoKing, for figuring out what that test does exactly.

Just found this. After doing

stty erase ^H kill ^X

on the real terminal from which you're running the regression tests, this regression test failure (and another one that was introduced in a0dcdee) goes away on FreeBSD. The regression test itself already issues that command, but apparently, FreeBSD's stty does not work correctly on a pty pseudoterminal…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed regressfail Regression test failure
Projects
None yet
Development

No branches or pull requests

2 participants