mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
fix(cmd): escape double quote characters in a tip
This commit is contained in:
parent
58b8b74e72
commit
6bd8921119
|
@ -106,6 +106,13 @@ local function get_posh_prompt(rprompt)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function set_posh_tooltip(command)
|
local function set_posh_tooltip(command)
|
||||||
|
if command == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
-- escape double quote characters properly, if any
|
||||||
|
command = string.gsub(command, '\\+"', '%1%1"')
|
||||||
|
command = string.gsub(command, '\\+$', '%1%1')
|
||||||
|
command = string.gsub(command, '"', '\\"')
|
||||||
local prompt_exe = string.format('%s print tooltip --shell=cmd --config=%s --command="%s"', omp_exe(), omp_config(), command)
|
local prompt_exe = string.format('%s print tooltip --shell=cmd --config=%s --command="%s"', omp_exe(), omp_config(), command)
|
||||||
local tooltip = run_posh_command(prompt_exe)
|
local tooltip = run_posh_command(prompt_exe)
|
||||||
if tooltip ~= "" then
|
if tooltip ~= "" then
|
||||||
|
|
Loading…
Reference in a new issue