Maxence Ahlouche <maxence.ahlou...@gmail.com> writes: > The length of %w should probably be computed starting from the last newline > in PROMPT1.
Good idea, but I think you need to account for "visible" (ie, if the newline is inside RL_PROMPT_START_IGNORE, it shouldn't change the width). It might be best to add logic inside the existing "if (visible)" instead of making a new top-level case. Another special case that somebody's likely to whine about is \t, though to handle that we'd have to make assumptions about the tab stop distance. Maybe assuming that it's 8 is good enough. regards, tom lane