Compare commits

...

3 commits

2 changed files with 10 additions and 3 deletions

View file

@ -158,8 +158,8 @@ pub fn codepointFromButton(b: wio.Button, mods: Mods) u21 {
}
pub const mouse_button_left: u8 = 0;
pub const mouse_button_right: u8 = 1;
pub const mouse_button_middle: u8 = 2;
pub const mouse_button_middle: u8 = 1;
pub const mouse_button_right: u8 = 2;
pub fn mouseButtonId(b: wio.Button) ?u8 {
return switch (b) {

View file

@ -1,6 +1,5 @@
const std = @import("std");
const builtin = @import("builtin");
const build_options = @import("build_options");
const Allocator = std.mem.Allocator;
const tp = @import("thespian");
@ -74,6 +73,8 @@ pub fn create(allocator: Allocator, parent: Plane, ctx: command.Context) !Widget
pub fn run_cmd(self: *Self, ctx: command.Context) !void {
var env = try std.process.getEnvMap(self.allocator);
errdefer env.deinit();
if (env.get("TERM") == null)
try env.put("TERM", "xterm-256color");
var cmd_arg: []const u8 = "";
var on_exit: TerminalOnExit = tui.config().terminal_on_exit;
@ -387,6 +388,12 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool {
std.log.err("terminal_view: draw failed: {}", .{e});
};
if (!software_cursor and self.focused and tui.terminal_has_focus()) {
const scr = &tui.rdr().vx.screen;
if (scr.cursor_vis)
tui.rdr().cursor_enable(@intCast(scr.cursor.row), @intCast(scr.cursor.col), scr.cursor_shape) catch {};
}
return false;
}