Bounty: 50
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_profile
that replicates the problem:
stty lnext ^-
bind -x '"C-v": "echo mapping works"'
- Start a Bash session.
- Press Ctrl-V -> see the output
mapping works
. -
Run
$ python3
. -
Use
exit()
or Ctrl-D to exit the REPL. -
Ctrl-V is back to it’s default behavior.
-
$ source ~/.bash_profile
the mapping still doesn’t work? -
$ source ~/.bash_profile
now Ctrl-V correctly producesmapping 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?