backspace not working in macvim shell

497 Views Asked by At

When I drop into the shell in macvim using the :shell command, using the backspace key doesn't delete, instead special characters are inserted as in the screenshot below:

macvim backspace

I have tried set nocompatible in my .vimrc but it made no difference.

Any idea how to fix this?

My .bashrc/.bash_profile is below

alias ll='ls -al'
# Set CLICOLOR if you want Ansi Colors in iTerm2
export CLICOLOR=1

# Set colors to match iTerm2 Terminal Colors
export TERM=xterm-256color

My .vimrc is below:

execute pathogen#infect()
execute pathogen#helptags()
syntax on
filetype plugin indent on
set number
set hidden

let mapleader="\<Space>"

" set colour scheme
set background=dark
colorscheme solarized

" NERDTree config
map <F5> :NERDTreeToggle<CR>
let NERDTreeIgnore=['^__py.*']
1

There are 1 best solutions below

2
On

Use

stty erase <Backspace>

When this works, you can add it in your $HOME/.bashrc