A little question context: this is happening inside the fish_prompt
function. The function works when called directly but not when called as the prompt.
The problem is that the terminal window is too narrow and Fish is not liking it for some undocumented reason. To work around the problem
- show one less character than the terminal length
- Put a newline after the loop
so the loop would look like
for x in (seq (math $W_COLS - 1))
echo -n '-'
end
echo
Thanks mainly goes to adisbladis on #fish