michaelmacinnis / oh

A new Unix shell.
MIT License
1.36k stars 55 forks source link

Can't set custom prompt with certain characters #53

Open eliminmax opened 1 year ago

eliminmax commented 1 year ago

Prompts with escape sequences to add color, or with symbols from Nerd Fonts, cause oh to print "invalid prompt" followed by a blank line, then exit.

michaelmacinnis commented 1 year ago

This is due to oh using github.com/peterh/liner: https://github.com/peterh/liner/blob/master/common.go#L66 https://github.com/peterh/liner/issues/135

eliminmax commented 1 year ago

I see. That sucks, but it doesn't seem to explain the issue with symbols from Nerd Fonts - they're just regular characters, which the font provides glyphs for.

eliminmax commented 1 year ago

Also should probably mention - if oh exits due to this issue, it returns a successful exit code (exit code 0). Given that this is only really an issue with interactive usage, it's probably not a big deal, but figured I'd at least make a note of it.