gnachman / iterm2-website

Website for iTerm2
http://iterm2.com/
GNU General Public License v2.0
80 stars 66 forks source link

Fix missing prompt when not using vi mode #79

Closed maxno-kivra closed 3 years ago

maxno-kivra commented 3 years ago

The prompt disappeared today when I updated the iTerm integration. The non-vi mode fish_prompt function wasn't calling the user defined fish_prompt, but a small copy paste later and it starts working again.

maxno-kivra commented 3 years ago

I also noticed

https://github.com/gnachman/iterm2-website/blob/5e9b1ddd1ebb8dfeae2bb299a504c0774538ad17/source/shell_integration/fish#L70

Which looks a bit odd (not fishy?). You can use return instead.

   function iterm2_common_prompt
        set -l last_status $status

        iterm2_status $last_status
        iterm2_write_remotehost_currentdir_uservars
        if not functions iterm2_fish_prompt | grep iterm2_prompt_mark > /dev/null
            iterm2_prompt_mark
        end

        return $last_status
   end

Should I add that to this PR? Or make a second one?

maxno-kivra commented 3 years ago

I moved the common prompt call to before the user prompt. I think this is more correct, but since I don't use vi-mode I'm not sure when the mode prompt is printed (and thus can deduce when the common prompt is called).

gnachman commented 3 years ago

Merged as 4271364. Thank you!