Rosettea / Hilbish

🌓 The Moon-powered shell! A comfy and extensible shell for Lua fans! 🌺 ✨
https://rosettea.github.io/Hilbish/
MIT License
496 stars 21 forks source link

fix: newline at start of prompt format string produces artifact #278

Closed tranzystorekk closed 8 months ago

tranzystorekk commented 8 months ago

I'm trying to get a multiline prompt that inserts a newline after command output for visual clarity.

With the following prompt config:

local function doPrompt(fail)
    hilbish.prompt(lunacolors.format(
        '\n{blue}%u {cyan}%d\n' .. (fail and '{red}' or '{green}') .. '∆ '
    ))
end

Instead of an empty line after command I'm getting a "highlighted" prompt triangle:

obraz

TorchedSammy commented 8 months ago

hilbish outputs that for lines that don't have a newline.

it would probably be better to use the command.exit hook:

bait.catch('command.exit', function()
    print ''
end)