2

When I copy data from outside to my emacs, it is garbled

(venv)  tree ./scripts
scripts
├── foo.sh
├── bar.sh
├── start.sh
├── stop.py

However, when I paste this in emacs, I get this:

(venv)  tree ./scripts
scripts
\u251c\u2500\u2500 foo.sh
\u251c\u2500\u2500 bar.sh
\u251c\u2500\u2500 start.sh
\u251c\u2500\u2500 stop.py

I thought this was due to simpleclip. But I also get this in my magit when I issue git standup (using : standup from within emacs)

  0 git … standup
[31mbe041bb[m - fix sort by name; closes #636 [32m(21 hours ago) [1;34m<darshanime>[m
[31mfa80601[m - change vul order [32m(22 hours ago) [1;34m<darshanime>[m

which should be:

(venv)  git standup      
be041bb - fix sort by name; closes #636 (21 hours ago) <darshanime>
fa80601 - change vul order (21 hours ago) <darshanime>
8
  • 1
    The second example seems to be ansi sequences not decoded. Don't know how you issue git standup, I assume from shell, so you may try to (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on).
    – theldoria
    Jun 2, 2017 at 8:43
  • 1
    The first example is something different, rather a problem with unicode. Probably the coding-system is wrong, what happens if you use (prefer-coding-system 'utf-8) or (prefer-coding-system 'utf-16) in your init.el?
    – theldoria
    Jun 2, 2017 at 8:49
  • in the 1st example, I get the garbled content, even after (prefer-coding-system 'utf-16) and (prefer-coding-system 'utf-8). Jun 2, 2017 at 9:41
  • These might help. (set-terminal-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8) (set-language-environment 'utf-8) (set-selection-coding-system 'utf-8) (setq locale-coding-system 'utf-8) (prefer-coding-system 'utf-8)
    – fhdhsni
    Jun 2, 2017 at 10:45
  • 2
    Possible duplicate of Pasting Text from Clipboard - why ^M instead of linebreaks?
    – rofrol
    Aug 2, 2018 at 18:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.