-
Notifications
You must be signed in to change notification settings - Fork 173
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
I'm trying to add shell integration using FinalTerm escape sequences following the OSC 133 ; <something> ST
format, but all these sequences from filter are removed before printing to the terminal.
ecma48_code::decode_osc
decodes these sequences as { .command = '1', .subcommand = '0', .visible = false }
and all !visible
OSC codes with the command
property between 0 and 2 (inclusive) are treated as set console title commands and skipped from the output:
clink/clink/terminal/src/ecma48_iter.cpp
Lines 560 to 571 in 17b5a3e
if (osc.visible) | |
{ | |
if (out) | |
out->concat(osc.output.c_str(), osc.output.length()); | |
if (cell_count) | |
cells += clink_wcwidth(osc.output.c_str(), osc.output.length()); | |
} | |
else if (!apply_title) | |
goto concat_verbatim; | |
else if (osc.command >= '0' && osc.command <= '2') | |
set_console_title(osc.param.c_str()); | |
else |
A simple example that demonstrates the problem:
local p = clink.promptfilter(10)
function p:filter(prompt)
-- OSC 133 sequences from prompt filter are removed before writing to the terminal
return "\001\x1b]133;D;"..os.geterrorlevel().."\007\002\001\x1b]133;A\007\002"..prompt.." \001\x1b]133;B\007\002"
end
local function command_executed_mark(input)
-- this works
clink.print("\001\x1b]133;C\007\002", NONL)
end
clink.onendedit(command_executed_mark)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working