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

Tab completion error when expanding ${.sh} #1461

Open
aweeraman opened this issue Jan 26, 2020 · 8 comments
Open

Tab completion error when expanding ${.sh} #1461

aweeraman opened this issue Jan 26, 2020 · 8 comments
Labels

Comments

@aweeraman
Copy link
Contributor

aweeraman commented Jan 26, 2020

Description of problem:
Error during tab completion when attempting to expand ${.sh}

Ksh version:
2020.0.0

Steps to reproduce:

  1. print ${.sh<TAB>

Actual results:
ksh: line 1: ${!.sh$@: bad substitution

Expected results:
print ${.sh.

  1. .sh.edchar 14) .sh.stats.globs
  2. .sh.edcol 15) .sh.stats.linesread
  3. .sh.edmode 16) .sh.stats.nv_cachehit
  4. .sh.level 17) .sh.stats.nv_opens
  5. .sh.lineno 18) .sh.stats.pathsearch
  6. .sh.match 19) .sh.stats.posixfuncall
  7. .sh.math 20) .sh.stats.simplecmds
  8. .sh.stats 21) .sh.stats.spawns
  9. .sh.stats.arg_cachehits 22) .sh.stats.subshell
  10. .sh.stats.arg_expands 23) .sh.subshell
  11. .sh.stats.comsubs 24) .sh.type
  12. .sh.stats.forks 25) .sh.version
  13. .sh.stats.funcalls

Additional info:
Linux ninsei 5.3.0-7625-generic #27157633700219.10~bc3488b-Ubuntu SMP Sat Dec 14 18:31:03 UTC x86_64 x86_64 x86_64 GNU/Linux

@krader1961 krader1961 added the bug label Jan 26, 2020
@krader1961
Copy link
Contributor

krader1961 commented Jan 26, 2020

This works in ksh93u+ but is broken in ksh93v-. Example # 666 why I wish we had started with the ksh93u+ branch.

@jghub
Copy link

jghub commented Jan 26, 2020

@aweeraman:
it is also example # 666 why ksh2020 would not be a good choice for the default ksh in any distro (let alone a replacement of ksh93 altogether). ksh93u+ remains the only viable choice for this, both, because of superior performance and also because of being better behaved/ less buggy. at least if you assign more importance to absence of bugs like the one you report here than to reduced built time (big deal around here...) and silencing of lint warnings.

a head-to-head comparison ksh93u+ vs. k2020 for user-visible bugs would be interesting, although the outcome seems clear: the "does work in ksh93u+ but not in ksh2020" (like in your case) is seen around here definitely way more often than "was already broken in ksh93u+ and is also broken in ksh2020" while "was already broken in ksh93u+ and now has been fixed" seems a rare beast indeed (again: restricting it to user-visible bugs, i.e. manifest and deterministic misbehaviour). actually, the latter category (user-visible bugs already operational in ksh93u+ for which the ksh2020 project did provide an acceptable, well-engineered fix) would be valuable information to have (maybe krader is willing/able to provide it, maybe not) in order to backport these patches to ksh93u+.

@aweeraman
Copy link
Contributor Author

@jghub I'm working towards getting ksh93u+ added to the Debian archive as well and support for the co-existence of the two shells so that users can make the choice. Will update this thread as we make progress on that.

@jghub
Copy link

jghub commented Jan 27, 2020

@aweeraman: I believe this is very good news and the way to go: provide both shells, name the packages unambiguously to avoid confusion between ksh93 and ksh2020 and let the users decide what they want (and what not!). so: thanks for your work. this is really appreciated!

@aweeraman
Copy link
Contributor Author

Just an update, @mirabilos has helped re-introduce ksh93 back and is currently sitting in the NEW queue and will be added to the archive, if all goes well. Meanwhile ksh2020 is updated to use the alternative system so the two can co-exist and is available on Debian testing. Meanwhile, let us support the 2020 team to fix the issues and collectively help move the project forward so we can keep the ksh legacy alive.

@jghub
Copy link

jghub commented Feb 1, 2020

@aweeraman: thank you for this update. as said, having both options is good. having only ksh2020 is bad. I do hope other distros will follow your example... regarding

Meanwhile, let us support the 2020 team to fix the issues and collectively help move the project forward so we can keep the ksh legacy alive.

this would be good indeed. my initial hope was that this project will achieve that. but I have lost all confidence that this can happen as long as krader is involved (or rather: as long as krader is deciding single-handedly what changes are done). I presume you are aware of his crude and hostile behaviour which alone is sufficient to prevent development of an agreeable and good community or even only willingness of any passerby to give ksh a try.

as just one out of so many cases, what do you make of krader's attitude and behaviour in these issues (looking at the whole threads or the most recent posts from yesterday/today):

#1449
#1464

I can assure you that I am watching this project only because of ksh and despite krader. and as many others before me I probably will turn away in due time ( if I am sure that ksh93u+ has found a different home). I maintain: this project urgently would need a reset. krader should not have commit access to the main repo but should fork and submit pull requests for others to review and decide. otherwise this project is destined to fail (or in the worst case to succeed in replacing something good by something inferior).

@krader1961
Copy link
Contributor

@jghub wrote

it is also example # 666 why ksh2020 would not be a good choice for the default ksh in any distro

That is an implicit admission that ksh93v- is not a "good choice for the default ksh in any distro" since the bug being discussed was introduced by the old AT&T AST team after the ksh93u+ release. It was not introduced by myself or anyone else who has actually committed changes intended to improve this project. Feel free to create a fork of the 2012-08-01-master (the ksh93u+) branch or the 2016-01-10-beta (the ksh93v-) branch. Then argue that your branch is superior to the current master branch.

@jghub
Copy link

jghub commented Feb 3, 2020

That is an implicit admission that ksh93v- is not a "good choice for the default ksh in any distro" s

restoring factual correctness cont'd.: this is not an "impliciit admission", but the expressed opinion of lots of people, me included: ksh93v- most definitely is not a good choice as default ksh. it is beta software. and ksh2020 is worse. that's why things have to change. hopefully will.

JohnoKing added a commit to JohnoKing/ksh that referenced this issue May 2, 2021
src/cmd/ksh93/tests/{basic.sh,builtins.sh,shtests}:
- Redirect error output from the ulimit builtin to silence irrelevant
  errors in the regression tests (these errors may occur when a
  command such as 'ulimit -t 4' is run before the regression tests).
- Shellquote the error messages from the getconf regression tests.

src/cmd/ksh93/tests/{arrays,io,variables}.sh:
- Backport the ksh2020 regression tests for the following bugs:
  <att#23>
  <att#203>
  <att#472>
  <att#492>

src/cmd/ksh93/tests/{basic,pty}.sh:
- Add regression tests for the following bugs:
  <att#1160>
  <att#1461>
- The ksh2020 fix for [ -t 1 ] in non-forking command substitutions
  caused the following bug in interactive shells:
    $ ( [ -t 1 ]; echo $? )
    1  # Always fails
  To avoid introducing this bug, this commit adds a regression
  test for it.
McDutchie pushed a commit to ksh93/ksh that referenced this issue May 3, 2021
…295)

src/cmd/ksh93/tests/{basic.sh,builtins.sh,shtests}:
- Redirect error output from the ulimit builtin to silence irrelevant
  errors in the regression tests (these errors may occur when a
  command such as 'ulimit -t 4' is run before the regression tests).
- Shellquote the error messages from the getconf regression tests.

src/cmd/ksh93/tests/{arrays,io,variables}.sh:
- Backport the ksh2020 regression tests for the following bugs:
  att#23
  att#203
  att#472
  att#492
- Minor fix to POSIX mode regression tests in ksh93v-. In ksh93v-,
  [[ -o ?posix ]] doesn't return an error (because it's implemented
  in the bash mode). However, 'set -o posix' will fail in ksh93v-
  if it's not in bash compatibility mode, which causes this test
  script to exit prematurely.

src/cmd/ksh93/tests/{basic,pty}.sh:
- Add test for att#1461
- The ksh2020 fix for [ -t 1 ] in non-forking command substitutions
  caused the following bug in interactive shells:
    $ ( [ -t 1 ]; echo $? )
    1  # Always fails
  To avoid introducing this bug, this commit adds a regression
  test for it.

src/cmd/ksh93/tests/functions.sh:
- Add test for att#1160
  Put the test to the start of functions.sh (if it's at the end
  of the script, it refuses to fail under ksh2020). Output from
  this regression test when run against ksh2020:
    functions.sh[46]: eval'ing function dumps function body to
    stdout (got $' { eval "bar() { FAILURE; }"; }\n { FAILURE; }')
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

3 participants