Skip to content

Commit 7883f0b

Browse files
committed
osh: interactive line editing/history/completion via GNU readline
osh built --without-readline, which disables ALL interactive features (line editing, history, completion) -- and Oils has no fallback editor: every path is gated behind HAVE_READLINE, and libedit's readline-compat layer is missing functions Oils calls (rl_list_funmap_names, rl_callback_sigcleanup, ...). So readline is the only way to give osh interactivity. LICENSING: GNU readline is GPLv3, so the osh binary is now a GPLv3 combined work (Oils itself is Apache-2.0). This is the only GPL artifact in the set; it was a deliberate choice to enable osh's interactive features. Add common/readline.sh: static GNU readline 8.3 built with musl-cross against the in-tree static ncurses, mirroring common/ncurses.sh (idempotent, fetch + checksums/sources/readline/). Because Oils probes and links a bare `-lreadline` with no `-lncurses`, the installed libreadline.a is merged with the in-tree ncurses (and libhistory.a) via `ar -M` into one self-contained archive, so the bare `-lreadline` resolves readline + history + termcap. Like ncurses/libedit the tarball is fetched fresh and checksum-verified; it is not committed (/build is gitignored). Wire it into osh: build readline, replace --without-readline with --readline <prefix> (the option exists since 0.25.0). Also add a musl `cc` wrapper alongside the existing `c++` one: Oils' configure feature probes (cc_quiet) default to the host `cc`, which cannot link the musl libreadline.a, so readline detection was silently failing and osh fell back to --without-readline; the wrapper makes the probes match the actual musl build (and keeps feature detection musl-accurate). Verified across the full range (0.25.0..0.37.0) on both arches: osh now links readline (the `history` builtin lists commands instead of erroring "Oils wasn't compiled with readline"), and core features are intact ($((6*7))=42, pattern matching). Regenerated checksums/build/{amd64,arm64}/osh_*; verify_build_checksums passes on both arches.
1 parent 40609f3 commit 7883f0b

29 files changed

Lines changed: 145 additions & 27 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
365241b29d2881f70f6b6de9f55c7b8cddd6efea7953584b0746b5c33267ee55 osh
1+
ea170512f2b75a5c1f8ecdd268c16f51c324bc0bee14733cc7ec25bd20a0dc0a osh
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ca041e9ccd8524cdf0dde8d0342017d5c532a9e7a432f86e40ea21c979857822 osh
1+
00cf5af4e5d42b89f52e5b6f5802fa8faaca6283f02f95a0ba7df59bced16c11 osh
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d79420ef4df4a663d5e50e71a9c0c46ff7f3462f3aa5cc19b351264410fd8bc6 osh
1+
f85cdae741df1c8ffea2a221a9bef5627c84690ba852d39edef97fcdab554be3 osh
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
93d9781ee97f4295be4585112eaf5163e454b2aa8751b0ff73fcf3643cc7f221 osh
1+
4d1b649117d6b5b01f7231eff8c0598a2c6cd79ffff4b7d2406b8b97f66d09c3 osh
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cc69da88311e051b5446ee0b8ef3b85862dc5cc4dcde7525c6c4578af8f52575 osh
1+
41403ab2a4d2b3be39d2338f6f02a598216479a5ab089d6fd24b09055bece79b osh
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
03a264098eba53d51b5ce4843a6ce6f9eca523beddce13f9f183ee01b648e8e8 osh
1+
2fa08b07548b95e2665c3d6fcafac29c826d47238cab6a5dde36c6e4b30ec79e osh
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9c786119b78d75b74ee4bafba324d653c4867a5e6bb4c8ef9f09a4726e6a3624 osh
1+
dfb3a8b14a01aefc8e33be53bcb7de59f09e40970046f86b339f3cd1dda29d4c osh
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f2830d79ed4b5aa0e87dea29f034276a51c60159e7a165127af7778bbf241f7b osh
1+
e46b4c840b1c450a3d0ee79497dba9c0e319c037b4ee4eebbf11ee0e4b9dabe8 osh
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
723d1b945d3ffceb15e749fbc94b2a1d299e70a1dcd1a0ea26dabda9b115d2ff osh
1+
67b234f43d3312f6052d8af2f0d367e8d0d5d757634a29b70a79efdb80781f65 osh
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7bef4d456c6eab2ef75baf9153f1c3542b5b91d27ae6c02552f651d9f9c2703f osh
1+
453aacb4f263181fc13382522d7ea44ba85a29c6fefccb37182cff41c545693b osh

0 commit comments

Comments
 (0)