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

stty erase returns "invalid argument" on MacOS #7357

Open
vigna opened this issue Feb 25, 2025 · 1 comment
Open

stty erase returns "invalid argument" on MacOS #7357

vigna opened this issue Feb 25, 2025 · 1 comment
Labels

Comments

@vigna
Copy link

vigna commented Feb 25, 2025

On MacOS stty returns an error instead of setting the erase character.

/bin/stty erase ^H

works as expected. But (from MacPorts)

/opt/local/libexec/uutils/stty erase ^H
/opt/local/libexec/uutils/stty: invalid argument 'erase'

Nonetheless, erase is listed as a control character:

/opt/local/libexec/uutils/stty -a
speed 9600 baud; rows 54; columns 169; 
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts 
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixoff -tandem ixon ixany imaxbel -iutf8 
opost -ocrnl onlcr -onocr -onlret -ofdel nl0 cr0 tab0 bs0 vt0 ff0 
isig icanon iexten echo echoe -echok -echonl -noflsh -tostop -echoprt echoctl echoke -flusho -extproc 

This behavior has also been replicated in debug mode on the current repo:

cargo build --bin coreutils --features macos
./target/debug/coreutils stty erase ^H
stty: invalid argument 'erase'
@sylvestre sylvestre added the good first issue For newcomers! label Feb 25, 2025
@tertsdiepraam
Copy link
Member

Thanks for filing! Here's a bit of guidance for people who want to look into this. This seems to be part of #3861, because setting special characters is not supported yet. So it's not just erase but all control characters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants