powerline?
This commit is contained in:
@@ -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
|
-- Send OSC 51 command to ZTerm for pane navigation
|
||||||
local function zterm_navigate(direction)
|
local function zterm_navigate(direction)
|
||||||
-- OSC 51;navigate;<direction> ST
|
-- OSC 51;navigate;<direction> ST
|
||||||
-- Using BEL (\007) as string terminator for better compatibility
|
-- Using BEL (\007) as string terminator for better compatibility
|
||||||
local osc = string.format("\027]51;navigate;%s\007", direction)
|
local osc = string.format("\027]51;navigate;%s\007", direction)
|
||||||
io.write(osc)
|
send_to_tty(osc)
|
||||||
io.flush()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Get the window number in a given direction, or 0 if none exists
|
-- Get the window number in a given direction, or 0 if none exists
|
||||||
@@ -122,8 +132,7 @@ end
|
|||||||
local function send_statusline(content)
|
local function send_statusline(content)
|
||||||
-- OSC 51;statusline;<content> ST
|
-- OSC 51;statusline;<content> ST
|
||||||
local osc = string.format("\027]51;statusline;%s\007", content or "")
|
local osc = string.format("\027]51;statusline;%s\007", content or "")
|
||||||
io.write(osc)
|
send_to_tty(osc)
|
||||||
io.flush()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Clear the ZTerm statusline (restore default)
|
-- Clear the ZTerm statusline (restore default)
|
||||||
|
|||||||
Reference in New Issue
Block a user