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

Integrate upstream dash changes into unbourne shell #656

Merged
merged 1 commit into from
Oct 11, 2022

Conversation

notwa
Copy link
Contributor

@notwa notwa commented Oct 10, 2022

this merges the changes from the previous commit (as listed in the source), up to the latest commit to dash, with the changes seen here:
https://git.kernel.org/pub/scm/utils/dash/dash.git/diff/?id=057cd650a4edd5856213d431a974ff35c6594489&id2=fba95e9e4a5d0f1f1ac9f7d86557e47bc0e2656c&context=5&ignorews=0&dt=0
patching was done by hand, but I've done several passes over the past day to make sure I got everything. note that I've omitted the changes from e.g. stat to stat64.


having an Actually Portable shell is potentially useful to me. however, I was running into bugs that had already been fixed upstream — this bug in particular, involving variable expansions. but after patching that, I figured I may as well apply the rest of the changes.

there are still some quirks on Windows, but my PR hasn't affected them at all:

  • only exec program checks paths for .com and .exe extensions; simply running program will not find program.exe in $PATH. is this intentional?
  • stderr does not play well when run from an MSYS2 terminal, either going silent or getting involuntarily captured(?). I can't even see the whole trace in this scenario because it gets eaten:
./unbourne.com --strace -c 'echo hello >&2'

Copy link
Owner

@jart jart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow a lot of work went into this. Thank you! This is one of the first things I put in the codebase and the way everything is smooshed together sort of reflects that, since the build tools weren't as good back then.

If you're running it on Windows, then the biggest issue I've encountered so far is the newline issue. Two of us have tried to fix the \n \r\n` thing so it can work better on Windows and failed because the almquist code is nontrivial to change.

I'd love to see that fixed somehow. In the meantime I've been using o//examples/cosh.com as my shell on Windows.

@jart jart merged commit 9209ea6 into jart:master Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants