Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ Everything below is truly optional in the sense that OmaFiles starts and runs fi
| **p7zip** | Extract `.7z` archives, and create them via the "Compress to .7z" option (browsing archives, and `.tar`-family extract/compress including `.tar.gz`, don't need this) |
| **unrar** | Extract `.rar` archives |
| **xdg-mime** | Registering Omafiles as the default file manager on first launch, and resolving the default app for "open with default" double-clicks (both best-effort, guarded by `command -v`) |
| **script (util-linux)** | Live intra-file percentage on archive compress/extract progress bars (fakes the TTY the archivers' isatty-gated progress output needs). Note some distros split it out of the core util-linux package — Fedora ships it as `util-linux-script`. Without it, jobs still run and complete normally, just without the live percentage |

**No longer required:** `xdg-terminal-exec`, `gio` (shell commands), `ffprobe`, `python-pygments`, `content-search.sh`, `empty-trash.sh`, and `inotifywait` have all been replaced by native C++ implementations.

Expand Down
23 changes: 18 additions & 5 deletions logic/ActionEngine.qml
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,25 @@ Item {
// near-universal isatty()-gated behavior CLI progress bars use, not
// specific to one tool -- it's why onLineRead only ever saw whole-line
// events (volume switches) and never the live intra-file percentage.
// `script` (util-linux, always present, no new dependency) is the
// standard way to fake a controlling terminal for exactly this case.
// -e makes it propagate the real child exit code (needed by
// archiveProc.onFinished); -q/-c: quiet, run this one command.
// `script` (util-linux) is the standard way to fake a controlling
// terminal for exactly this case. -e makes it propagate the real child
// exit code (needed by archiveProc.onFinished); -q/-c: quiet, run this
// one command.
//
// NOT unconditionally though: some distros split the binary out of the
// core util-linux package (Fedora ships it as `util-linux-script`), and
// when it is absent the process never starts, so every compress/extract
// silently hung with the transfer queue jammed behind it. Probing with
// `command -v` inside the wrapper costs nothing and degrades gracefully:
// without `script` the job still runs to completion and reports
// success/failure normally -- it only loses the live intra-file
// percentage (isatty-gated in the archivers), keeping the whole-line
// events (per-file/volume lines) that onLineRead also parses.
function _ptyArgs(cmd) {
return ["script", "-qec", "bash -c " + Util.shellQuote(cmd), "/dev/null"]
var inner = "bash -c " + Util.shellQuote(cmd)
return ["bash", "-c",
"if command -v script >/dev/null 2>&1; then exec script -qec "
+ Util.shellQuote(inner) + " /dev/null; else exec " + inner + "; fi"]
}

function runActionWithProgress(cmd, busyLabel, total, onSuccess, volumes) {
Expand Down