'Fish is not returning to new line after executing bind

I'm binding Ctrl+f to fg so I can Ctrl+z and Ctrl+f back into vim. However after two times doing the combo twice, it ruins the terminal:

user@pc:~$ vim
Job 1, 'vim' has stopped
user@pc:~$ Send job 1, “vim” to foreground
Job 1, 'vim' has stopped
^F▉

Cursor is now not on a line (which begins with user@pc) and executing any command show it as string (^Fas example).

Pressing enter fixes this, but there should be a better solution.

Edit: using bind \cf 'fg; commandline -f repaint' shows the PS1, but it's still in text mode, meaning pressing Ctrl+f, doesn't run fg but outputs ^F.



Solution 1:[1]

Solution was to instad of using:

bind \cf 'fg'

use:

bind \cf 'fg; commandline -f execute'

It ocassionaly does an extra enter, but whatever.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 d9ngle