mirror of
https://github.com/topjohnwu/Magisk.git
synced 2026-07-03 14:08:39 +02:00
Redirect stdin to PTY for terminal size queries
Use `<>$ptyPath >&0 2>&0` to connect all three fds (stdin/stdout/stderr) to the PTY slave, so scripts can query terminal dimensions via stty size. Made-with: Cursor
This commit is contained in:
@@ -190,7 +190,7 @@ class FlashViewModel : BaseViewModel() {
|
||||
"sh $dir/update-binary dummy 1 '${zipFile.absolutePath}'; " +
|
||||
"EXIT=\$?; " +
|
||||
"if [ \$EXIT -ne 0 ]; then echo '! Installation failed'; fi; " +
|
||||
"exit \$EXIT) >$ptyPath 2>&1"
|
||||
"exit \$EXIT) <>$ptyPath >&0 2>&0"
|
||||
).exec().isSuccess
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class ActionViewModel : BaseViewModel() {
|
||||
|
||||
val success = withContext(Dispatchers.IO) {
|
||||
Shell.cmd(
|
||||
"(export TERM=xterm-256color; run_action '$actionId') >$ptyPath 2>&1"
|
||||
"(export TERM=xterm-256color; run_action '$actionId') <>$ptyPath >&0 2>&0"
|
||||
).exec().isSuccess
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user