Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set up path on prompt on pycharm terminal windon

I just upgrade pycharm into 2016.3.1. Before upgrade, I do not have problem to see the current directory path under the prompt on terminal window. After upgrade into pycharm 2016 3.1. All directory path on prompt on terminal window seems like messed up with 133;C;133;D;01337;RemoteHost=hawkins@pc_name.home1337;CurrentDir=/Users/hawkins/path133;MAC:path hawkins$ 133;B for some reason. Anyone have expereience on how to resolve this?

MAC:path$
133;C;133;D;01337;RemoteHost=hawkins@pc_name.home1337;CurrentDir=/Users/hawkins/path133;MAC:path hawkins$ 133;B
133;C;133;D;01337;RemoteHost=hawkins@pc_name.home1337;CurrentDir=/Users/hawkins/path133;MAC:path hawkins$ 133;B
133;C;133;D;01337;RemoteHost=hawkins@pc_name.home1337;CurrentDir=/Users/hawkins/path133;MAC:path hawkins$ 133;B
like image 418
jacobcan118 Avatar asked Dec 18 '16 04:12

jacobcan118


2 Answers

I had a similar problem. It turned out my problem was due to have iTerm shell integration installed. As you have tagged the question [osx], I assume that you might also have done this.

There is a nice explanation to what these strange symbols mean in this answer: https://unix.stackexchange.com/a/294886/47407

I figured I could avoid having to uninstall Shell Integration by clearing my PROMT_COMMAND, and setting PS1 again. I made a shell script called pycharm_terminal.sh with the following

export PROMT_COMMAND=
export PS1="\[\e[31m\]\u\[\e[0m\] at \[\e[33m\]\h\[\e[0m\] in \[\e[32m\]\w\[\e[0m\] at [\A] \[\033[31m\]`git branch 2> /dev/null | grep -e ^* | sed -E  s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`\[\033[35m\]\n$ \[\033[00m\]"
bash -i

The PS1 variable can be set to whatever you had before. This is just how I like mine.

Now, in PyCharm Settings: Go to Tools > Terminal and in "Shell path" set it to /bin/bash <path_to_pycharm_terminal.sh>.

Now try opening a new terminal in PyCharm. It shouldn't have those control character errors.

like image 190
KPLauritzen Avatar answered Sep 28 '22 01:09

KPLauritzen


Solution that worked for me:

  1. Go to Settings > Plugins
  2. Find plugin "Python Terminal" and disable it
  3. Restart PyCharm

The only negative effect I've noticed - auto activation of virtualenv on terminal start doesn't work.

like image 23
Gorini4 Avatar answered Sep 28 '22 01:09

Gorini4