Zig NEWS

Discussion on: Want to create a TUI application? - The Basics of "Uncooked" Terminal IO

Collapse
 
haoliang profile image
haoliang

insightful post! you had not mentioned the mouse support, could you give some directions?

Collapse
 
haoliang profile image
haoliang

luckily, i found some code in termion to do that.

/// A sequence of escape codes to enable terminal mouse support.
const ENTER_MOUSE_SEQUENCE: &'static str = csi!("?1000h\x1b[?1002h\x1b[?1015h\x1b[?1006h");

/// A sequence of escape codes to disable terminal mouse support.
const EXIT_MOUSE_SEQUENCE: &'static str = csi!("?1006l\x1b[?1015l\x1b[?1002l\x1b[?1000l");
Enter fullscreen mode Exit fullscreen mode
Collapse
 
jpl profile image
Jean-Pierre

Thank you

Just a remark
I tested with 0.10.0 or 0.11.0 dev 945
I have a problem with
tty = try fs.cwd().openFile("/dev/tty", .{ .read = true, .write = true });
and I returned:
tty = fs.cwd().openFile("/dev/tty", .{ .mode = .read_write}) catch unreachable;

i work with linux