Fix emacs copy/paste in terminal mode