Escape both % and $ in the command line

Fixes issue #1884
Merge pull request #1885 from eakret/termsupport-fix

Escape both % and $ in the command line