You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "paulk-asert (via GitHub)" <gi...@apache.org> on 2026/09/02 20:59:24 UTC
[PR] GROOVY-12341: sync GroovyPosixCommands with JLine's control-character… [groovy]
paulk-asert opened a new pull request, #2865:
URL: https://github.com/apache/groovy/pull/2865
… fix
/ls wrote file names and symlink targets into styled terminal output as they came off disk. A name is data supplied by whoever created it, not text the user asked to render, so an escape sequence embedded in one is executed by the terminal - hiding output, spoofing what is displayed, or reaching an emulator bug. coreutils and BSD ls quote such characters for this reason.
JLine fixed this upstream in 4.4.1 (jline#2200) and Groovy does not receive it: GroovyPosixCommands is a fork, and Main.posixCommand dispatches /ls, /wc, /head, /tail and /grep to it, registering JLine's implementations only so their --help text can be read. Bumping the dependency upgrades code these commands never run. The helper and its ten call sites are therefore ported here, matching upstream one for one.
Ported rather than improved on, deliberately. Upstream strips the control characters; coreutils quotes them, which preserves the distinction between two names that differ only by what was stripped. Quoting may well be better, but rewriting it here is how this file drifted far enough to miss the fix in the first place - that argument belongs upstream, where everyone would get the result.
Stripping removes the ESC that makes a sequence a command and leaves the printable remainder, which is inert; the tests assert exactly that, since the surrounding output legitimately carries escapes of its own for colour.
jline#2052, which restricts getSources to local jar: archives, is not ported: this fork has no jar: branch to restrict. The lasting fix for both is to stop forking - see the register's note on teaching upstream getSources to read a variable, which would let this file be deleted and take this patch with it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-12341: sync GroovyPosixCommands with JLine's control-character… [groovy]
Posted by "paulk-asert (via GitHub)" <gi...@apache.org>.
paulk-asert merged PR #2865:
URL: https://github.com/apache/groovy/pull/2865
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-12341: sync GroovyPosixCommands with JLine's control-character… [groovy]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #2865:
URL: https://github.com/apache/groovy/pull/2865#issuecomment-5516619925
## 🚨 TestLens detected 3 failed tests 🚨
Here is what you can do:
1) Inspect the test failures carefully.
2) If you are convinced that some of the tests are flaky, you can mute them below.
3) Finally, trigger a rerun by checking the rerun checkbox.
### Test Summary
#### [Build and test / lts \(17, windows-latest, 1\)](https://github.com/apache/groovy/actions/runs/33682542225/job/100422272101?pr=2865) > :groovy-groovysh:test
| Test | Runs | Flakiness |
|---|---|--:|
| GroovyPosixCommandsTest > headAndGrepAndWcStripControlCharactersFromNames\(\) | ❌ | 0% 🟢 |
| GroovyPosixCommandsTest > lsStripsControlCharactersFromFileNames\(\) | ❌ | 0% 🟢 |
| GroovyPosixCommandsTest > lsStripsControlCharactersFromSymlinkTargets\(\) | ❌ | 0% 🟢 |
🏷️ Commit: 55d6a1f1157c433b22316b400a0dd5398dc225b0
▶️ Tests: 79515 executed
🟡 Checks: 11/29 completed
### Test Failures
<details><summary><strong>GroovyPosixCommandsTest > headAndGrepAndWcStripControlCharactersFromNames()</strong> (:groovy-groovysh:test in <a href="https://github.com/apache/groovy/actions/runs/33682542225/job/100422272101?pr=2865">Build and test / lts (17, windows-latest, 1)</a>)</summary>
```
java.nio.file.InvalidPathException: Illegal char <> at index 2: ok[2Ktrap.txt
at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
at java.base/java.nio.file.Path.resolve(Path.java:515)
at java.base/jdk.internal.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:391)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:298)
at org.codehaus.groovy.vmplugin.v8.IndyInterface.invokeColdReflective(IndyInterface.java:648)
at org.apache.groovy.groovysh.jline.GroovyPosixCommandsTest.headAndGrepAndWcStripControlCharactersFromNames(GroovyPosixCommandsTest.groovy:123)
```
</details>
<details><summary><strong>GroovyPosixCommandsTest > lsStripsControlCharactersFromFileNames()</strong> (:groovy-groovysh:test in <a href="https://github.com/apache/groovy/actions/runs/33682542225/job/100422272101?pr=2865">Build and test / lts (17, windows-latest, 1)</a>)</summary>
```
java.nio.file.InvalidPathException: Illegal char <> at index 2: ok[2Ktrap.txt
at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
at java.base/java.nio.file.Path.resolve(Path.java:515)
at java.base/jdk.internal.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:391)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:298)
at org.codehaus.groovy.vmplugin.v8.IndyInterface.invokeColdReflective(IndyInterface.java:648)
at org.apache.groovy.groovysh.jline.GroovyPosixCommandsTest.lsStripsControlCharactersFromFileNames(GroovyPosixCommandsTest.groovy:97)
```
</details>
<details><summary><strong>GroovyPosixCommandsTest > lsStripsControlCharactersFromSymlinkTargets()</strong> (:groovy-groovysh:test in <a href="https://github.com/apache/groovy/actions/runs/33682542225/job/100422272101?pr=2865">Build and test / lts (17, windows-latest, 1)</a>)</summary>
```
java.nio.file.InvalidPathException: Illegal char <> at index 2: ok[2Ktrap.txt
at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
at java.base/java.nio.file.Path.resolve(Path.java:515)
at java.base/jdk.internal.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:391)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:298)
at org.codehaus.groovy.vmplugin.v8.IndyInterface.invokeColdReflective(IndyInterface.java:648)
at org.apache.groovy.groovysh.jline.GroovyPosixCommandsTest.lsStripsControlCharactersFromSymlinkTargets(GroovyPosixCommandsTest.groovy:108)
```
</details>
### Rerun Controls
> [!NOTE]
> Checks are currently running using the configuration below.
Select tests to mute in this pull request:
🔲 GroovyPosixCommandsTest > headAndGrepAndWcStripControlCharactersFromNames\(\) <!-- uniqueId=[engine:junit-jupiter]/[class:org.apache.groovy.groovysh.jline.GroovyPosixCommandsTest]/[method:headAndGrepAndWcStripControlCharactersFromNames()] -->
🔲 GroovyPosixCommandsTest > lsStripsControlCharactersFromFileNames\(\) <!-- uniqueId=[engine:junit-jupiter]/[class:org.apache.groovy.groovysh.jline.GroovyPosixCommandsTest]/[method:lsStripsControlCharactersFromFileNames()] -->
🔲 GroovyPosixCommandsTest > lsStripsControlCharactersFromSymlinkTargets\(\) <!-- uniqueId=[engine:junit-jupiter]/[class:org.apache.groovy.groovysh.jline.GroovyPosixCommandsTest]/[method:lsStripsControlCharactersFromSymlinkTargets()] -->
Reuse successful test results:
🔲 ♻️ Only rerun the tests that failed or were muted before
Click the checkbox to trigger a rerun:
🔲 **Rerun jobs**
---
_Learn more about TestLens at [testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-12341: sync GroovyPosixCommands with JLine's control-character… [groovy]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #2865:
URL: https://github.com/apache/groovy/pull/2865#issuecomment-5516744719
## [Codecov](https://app.codecov.io/gh/apache/groovy/pull/2865?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `61.11111%` with `7 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 70.9283%. Comparing base ([`ee41588`](https://app.codecov.io/gh/apache/groovy/commit/ee415888471bd650774c1b02f70e1e13a942b74d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`55d6a1f`](https://app.codecov.io/gh/apache/groovy/commit/55d6a1f1157c433b22316b400a0dd5398dc225b0?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 5 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/2865?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...che/groovy/groovysh/jline/GroovyPosixCommands.java](https://app.codecov.io/gh/apache/groovy/pull/2865?src=pr&el=tree&filepath=subprojects%2Fgroovy-groovysh%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fapache%2Fgroovy%2Fgroovysh%2Fjline%2FGroovyPosixCommands.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LWdyb292eXNoL3NyYy9tYWluL2dyb292eS9vcmcvYXBhY2hlL2dyb292eS9ncm9vdnlzaC9qbGluZS9Hcm9vdnlQb3NpeENvbW1hbmRzLmphdmE=) | 61.1111% | [5 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/groovy/pull/2865?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/groovy/pull/2865?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #2865 +/- ##
==================================================
+ Coverage 70.8093% 70.9283% +0.1190%
- Complexity 36992 37033 +41
==================================================
Files 1576 1576
Lines 134793 134839 +46
Branches 24965 24970 +5
==================================================
+ Hits 95446 95639 +193
+ Misses 30740 30539 -201
- Partials 8607 8661 +54
```
| [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/2865?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...che/groovy/groovysh/jline/GroovyPosixCommands.java](https://app.codecov.io/gh/apache/groovy/pull/2865?src=pr&el=tree&filepath=subprojects%2Fgroovy-groovysh%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fapache%2Fgroovy%2Fgroovysh%2Fjline%2FGroovyPosixCommands.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LWdyb292eXNoL3NyYy9tYWluL2dyb292eS9vcmcvYXBhY2hlL2dyb292eS9ncm9vdnlzaC9qbGluZS9Hcm9vdnlQb3NpeENvbW1hbmRzLmphdmE=) | `43.3824% <61.1111%> (+23.4419%)` | :arrow_up: |
... and [12 files with indirect coverage changes](https://app.codecov.io/gh/apache/groovy/pull/2865/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org