From e54f316d0f98da8e82aab04ea243c02c8956110c Mon Sep 17 00:00:00 2001 From: Zacharias-Brohn Date: Tue, 16 Dec 2025 21:55:00 +0100 Subject: [PATCH] powerline? --- lua/zterm-navigator/init.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lua/zterm-navigator/init.lua b/lua/zterm-navigator/init.lua index 5280b45..6e68547 100644 --- a/lua/zterm-navigator/init.lua +++ b/lua/zterm-navigator/init.lua @@ -35,13 +35,23 @@ M.config = { }, } +-- Send raw escape sequence to the terminal, bypassing neovim's terminal handling +local function send_to_tty(str) + -- Write directly to /dev/tty to bypass neovim's terminal buffer + local tty = io.open("/dev/tty", "w") + if tty then + tty:write(str) + tty:flush() + tty:close() + end +end + -- Send OSC 51 command to ZTerm for pane navigation local function zterm_navigate(direction) -- OSC 51;navigate; ST -- Using BEL (\007) as string terminator for better compatibility local osc = string.format("\027]51;navigate;%s\007", direction) - io.write(osc) - io.flush() + send_to_tty(osc) end -- Get the window number in a given direction, or 0 if none exists @@ -122,8 +132,7 @@ end local function send_statusline(content) -- OSC 51;statusline; ST local osc = string.format("\027]51;statusline;%s\007", content or "") - io.write(osc) - io.flush() + send_to_tty(osc) end -- Clear the ZTerm statusline (restore default)