summaryrefslogtreecommitdiff
path: root/src/echo.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/echo.zig')
-rw-r--r--src/echo.zig10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/echo.zig b/src/echo.zig
index e25953e0..e98aff49 100644
--- a/src/echo.zig
+++ b/src/echo.zig
@@ -149,7 +149,7 @@ pub const Echo = struct {
/// it was applied here at once (so it was no key into a terminal).
pub fn typed(e: *Echo, c: *Pardes, view: u8, ev: pardes.Event, seq: u32, applied: bool) void {
e.view = view;
- if (applied or comptime !terminal.enabled) return;
+ if (applied) return;
switch (ev) {
// ponytail: a motion or focus report a program asked for could
// move its cursor; the judgement catches that.
@@ -310,7 +310,6 @@ pub const Echo = struct {
}
fn screenCell(e: *const Echo, state: *terminal.State, x: u16, row: u64) ?terminal.PageCell {
- if (comptime !terminal.enabled) return null;
const top = e.tops[e.pane];
if (row < top or row - top >= state.vt.rows) return null;
return state.vt.screens.active.pages.getCell(.{ .active = .{ .x = x, .y = @intCast(row - top) } });
@@ -379,7 +378,6 @@ pub const Echo = struct {
}
fn judge(e: *Echo, c: *Pardes, slack: u64) void {
- if (comptime !terminal.enabled) return;
if (e.n == 0 and e.cursor == null) return;
const now = e.time();
const pane = c.panes[e.pane] orelse return e.drop();
@@ -446,7 +444,6 @@ pub const Echo = struct {
/// Over terminal pane `id`'s body, as renderBody drew it: the
/// characters predicted and the cursor after them.
pub fn paint(e: *const Echo, p: *const Pardes, s: *Surface, pane: *const Pane, id: usize, tx: u16, tw: u16, body_y: u16, body_h: u16, active: bool) void {
- if (comptime !terminal.enabled) return;
if (e.n == 0 and e.cursor == null) return;
if (id != e.pane or pane.serial != e.serial or p.view != e.view or pane.body.mode != .tty) return;
if (!e.visible(p)) return;
@@ -534,7 +531,6 @@ fn blank(cp: u21) bool {
/// since) and the cursor's own, on the primary screen. A shell without
/// pardes's marks is trusted only once its echo is confirmed.
fn atPrompt(pane: *const Pane) bool {
- if (comptime !terminal.enabled) return false;
const state = pane.terminal orelse return false;
return state.vt.screens.active_key == .primary and state.stream.handler.phase == .input and terminal.promptInputReady(pane);
}
@@ -655,7 +651,6 @@ const Rig = struct {
const prompt = "\x1b]133;A;cl=line;aid=pardes\x07$ \x1b]133;B;aid=pardes\x07";
test "keys typed at a shell's prompt are drawn at once, and the authority's echo takes their place" {
- if (comptime !terminal.enabled) return error.SkipZigTest;
var g: Rig = undefined;
try g.init();
defer g.deinit();
@@ -703,7 +698,6 @@ test "keys typed at a shell's prompt are drawn at once, and the authority's echo
}
test "a password prompt shows nothing typed, and a full-screen program is not predicted" {
- if (comptime !terminal.enabled) return error.SkipZigTest;
var g: Rig = undefined;
try g.init();
defer g.deinit();
@@ -735,7 +729,6 @@ test "a password prompt shows nothing typed, and a full-screen program is not pr
}
test "keys still on their way when their predictions go: the next waits for their echo, never predicted where it is about to land" {
- if (comptime !terminal.enabled) return error.SkipZigTest;
var g: Rig = undefined;
try g.init();
defer g.deinit();
@@ -773,7 +766,6 @@ test "keys still on their way when their predictions go: the next waits for thei
}
test "a misprediction takes every prediction back and shows none until an echo is confirmed; after Tab nothing is predicted until its echo" {
- if (comptime !terminal.enabled) return error.SkipZigTest;
var g: Rig = undefined;
try g.init();
defer g.deinit();