M-x eshell is a shell implemented completely in Emacs Lisp and integrates with Emacs really nicely
setxkbmap -option ctrl:nocaps xmodmap -e "keycode 107 = Control_R"
https://www.masteringemacs.org/article/running-shells-in-ema...
(the whole site has lots of information about emacs)