From 1855fba32fe0039c3a90543c4ee3a8cc9e39c810 Mon Sep 17 00:00:00 2001 From: Zacharias-Brohn Date: Tue, 16 Dec 2025 22:14:20 +0100 Subject: [PATCH] powerline? --- lua/zterm-navigator/init.lua | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/lua/zterm-navigator/init.lua b/lua/zterm-navigator/init.lua index beb9bb0..a8a5e42 100644 --- a/lua/zterm-navigator/init.lua +++ b/lua/zterm-navigator/init.lua @@ -36,31 +36,14 @@ M.config = { } -- Send raw escape sequence to the terminal, bypassing neovim's terminal handling. --- We use multiple fallback strategies to find a working method. +-- We spawn a shell process to write directly to the TTY, which bypasses neovim completely. local function send_to_tty(str) - -- Strategy 1: Use nvim_chan_send to channel 2 (stderr) - -- This often bypasses neovim's terminal buffer processing - local ok = pcall(vim.api.nvim_chan_send, 2, str) - if ok then - return - end - - -- Strategy 2: Write to stderr directly - -- stderr is typically unbuffered and may bypass neovim - ok = pcall(function() - io.stderr:write(str) - io.stderr:flush() - end) - if ok then - return - end - - -- Strategy 3: Use terminfo/termcap passthrough if available - -- This is a last resort - pcall(function() - io.write(str) - io.flush() - end) + -- Use printf in a subprocess - this writes directly to the terminal + -- The subprocess inherits the TTY and can write to it directly + vim.fn.jobstart({ 'printf', '%s', str }, { + detach = true, + on_exit = function() end, + }) end -- Send OSC 51 command to ZTerm for pane navigation