mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
cli/list-keybinds: prevent ios, tvos, and watchos from pretty printing
These oses don't supply a tty layer, which prevents us from using the libvaxis tty. Eventually we can add in using stdout as a writer. For now, we just don't pretty print there.
This commit is contained in:
@ -57,8 +57,13 @@ pub fn run(alloc: Allocator) !u8 {
|
|||||||
defer config.deinit();
|
defer config.deinit();
|
||||||
|
|
||||||
const stdout = std.io.getStdOut();
|
const stdout = std.io.getStdOut();
|
||||||
|
|
||||||
|
const can_pretty_print = switch (builtin.os.tag) {
|
||||||
|
.ios, .tvos, .watchos => false,
|
||||||
|
else => true,
|
||||||
|
};
|
||||||
// Despite being under the posix namespace, this also works on Windows as of zig 0.13.0
|
// Despite being under the posix namespace, this also works on Windows as of zig 0.13.0
|
||||||
if (std.posix.isatty(stdout.handle) and !opts.plain) {
|
if (can_pretty_print and !opts.plain and std.posix.isatty(stdout.handle)) {
|
||||||
return prettyPrint(alloc, config.keybind);
|
return prettyPrint(alloc, config.keybind);
|
||||||
} else {
|
} else {
|
||||||
try config.keybind.formatEntryDocs(
|
try config.keybind.formatEntryDocs(
|
||||||
|
Reference in New Issue
Block a user