Compare commits
2 Commits
a93f3ad9f6
...
v1.1.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80d2e7fd71 | ||
|
|
03e1311e90 |
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -1203,7 +1203,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ostiary"
|
||||
version = "1.1.3"
|
||||
version = "1.1.4"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "ostiary"
|
||||
version = "1.1.3"
|
||||
version = "1.1.4"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -109,7 +109,7 @@ fi
|
||||
echo ""
|
||||
ok "Launching ${BINARY}..."
|
||||
if { true </dev/tty; } 2>/dev/null; then
|
||||
exec "$INSTALL_DIR/$BINARY"
|
||||
"$INSTALL_DIR/$BINARY"
|
||||
else
|
||||
ok "Run: $BINARY"
|
||||
fi
|
||||
|
||||
14
src/main.rs
14
src/main.rs
@@ -12,6 +12,8 @@ mod updater;
|
||||
|
||||
use std::io;
|
||||
use anyhow::Result;
|
||||
#[cfg(unix)]
|
||||
use libc;
|
||||
use crossterm::{
|
||||
event::{DisableMouseCapture, EnableMouseCapture},
|
||||
execute,
|
||||
@@ -29,6 +31,18 @@ async fn main() -> Result<()> {
|
||||
config::Config::create_with_endpoint(&url, &name)?
|
||||
};
|
||||
|
||||
// Before initializing the TUI, ensure our process group is the terminal's
|
||||
// foreground group. When launched from a non-interactive install script on
|
||||
// macOS, the parent shell may not have granted terminal ownership, causing
|
||||
// crossterm's kqueue-based input reader to fail silently.
|
||||
#[cfg(unix)]
|
||||
{
|
||||
use std::os::unix::io::AsRawFd;
|
||||
if let Ok(tty) = std::fs::File::open("/dev/tty") {
|
||||
unsafe { libc::tcsetpgrp(tty.as_raw_fd(), libc::getpgrp()); }
|
||||
}
|
||||
}
|
||||
|
||||
enable_raw_mode()?;
|
||||
let mut stdout = io::stdout();
|
||||
execute!(stdout, EnterAlternateScreen, EnableMouseCapture)?;
|
||||
|
||||
Reference in New Issue
Block a user