First add the following lines to your .emacs file:
;; Use Emacs terminfo, not system terminfo
(setq system-uses-terminfo nil)
If this doesn't work, then do the following:
tic -o ~/.terminfo /Applications/Emacs.app/Contents/Resources/etc/e/eterm-color.ti
Add the following lines to your .emacs file:
;; IPython
(setq python-shell-interpreter "ipython"
python-shell-interpreter-args "-i")
C-c C-j to go into line mode C-c C-k to get back into char mode to interact with the terminal
(defun copy-from-osx ()
(shell-command-to-string "pbpaste"))
(defun paste-to-osx (text &optional push)
(let ((process-connection-type nil))
(let ((proc (start-process "pbcopy" "*Messages*" "pbcopy")))
(process-send-string proc text)
(process-send-eof proc))))
(setq interprogram-cut-function 'paste-to-osx)
(setq interprogram-paste-function 'copy-from-osx)