I have mapped Ctrl-V in my
.bash_profile to a function that opens a file in Vim using fzf. It works perfectly, but whenever I exit from the Python REPL the mapping doesn’t work until I source my
.bash_profile twice or start a completely new shell session.
Steps to reproduce:
- Use this minimal
.bash_profilethat replicates the problem:
stty lnext ^- bind -x '"C-v": "echo mapping works"'
- Start a Bash session.
- Press Ctrl-V -> see the output
exit()or Ctrl-D to exit the REPL.
Ctrl-V is back to it’s default behavior.
$ source ~/.bash_profilethe mapping still doesn’t work?
$ source ~/.bash_profilenow Ctrl-V correctly produces
mapping works, how?
Why does starting/exiting the Python REPL affect my Ctrl-V mapping (this does not happen to my other mappings)? And why do I need to source my profile twice for the mapping to start working?