In a regular terminal (e.g. iTerm2 on OS X) I can connect to a database, e.g.
> psql ....
and then, as I type my command in
$ select foo from bar
I can move around (as I type psql commands) using the standard
However, if I try to do this in a shell within Emacs (
ansi-term), it doesn't work.
More specifically, if I start a shell (e.g. Bash) within
ansi-term, the keystrokes
Alt+f work fine in the Unix shell (in this case, Bash), BUT if I then drop into
psql from within the shell, the keystrokes
Alt+f stop working (the keystrokes won't move the cursor, and I can't keep typing commands properly anymore)
Why is this? And how can fix this behavior?
I narrowed the problem and the line in my
.zshrc that causes this behavior is the following one:
I have this line because its's the best solution that I found to fix the problem that I report in this thread: Emacs multi-term not displaying special characters correctly
Update 2 (solution, but why?):
I found the solution in this thread: Weird character zsh in emacs terminal. As the top answer says, I had to create
terminfo by using following command: (note that the
terminfo path may be different from your system)
# If you use Cocoa Emacs or Carbon Emacs tic -o ~/.terminfo /Applications/Emacs.app/Contents/Resources/etc/e/eterm-color.ti