diff --git a/.idea/libraries/pty4j.xml b/.idea/libraries/pty4j.xml
index 49401186e946..6ff8d23d1170 100644
--- a/.idea/libraries/pty4j.xml
+++ b/.idea/libraries/pty4j.xml
@@ -1,11 +1,11 @@
-
+
-
+
diff --git a/build/scripts/libLicenses.gant b/build/scripts/libLicenses.gant
index a295e970a802..0f19c810fe79 100644
--- a/build/scripts/libLicenses.gant
+++ b/build/scripts/libLicenses.gant
@@ -227,7 +227,7 @@ libraryLicense(name: "Jaxen", version: "", license: "modified Apache", url: "htt
libraryLicense(name: "jayatana", libraryName: "jayatana", version: "1.2.4", license: "MIT License", url: "https://code.google.com/p/java-swing-ayatana/", licenseUrl: "http://opensource.org/licenses/mit-license.php")
libraryLicense(name: "JCIP Annotations", libraryName: "jcip", license: "Creative Commons Attribution License", url: "http://www.jcip.net", licenseUrl: "http://creativecommons.org/licenses/by/2.5")
libraryLicense(name: "JDOM", version: "1.1 (with patches by JetBrains)", license: "modified Apache", url: "http://www.jdom.org/", licenseUrl: "http://www.jdom.org/docs/faq.html#a0030")
-libraryLicense(name: "JediTerm", libraryName: "jediterm-pty", version: "0.2", license: "LGPL 2", url: "https://github.com/traff/jediterm", licenseUrl: "https://github.com/traff/jediterm/blob/master/COPYING")
+libraryLicense(name: "JediTerm", libraryName: "jediterm-pty", version: "2.2", license: "LGPL 2", url: "https://github.com/JetBrains/jediterm", licenseUrl: "https://github.com/JetBrains/jediterm/blob/master/COPYING")
libraryLicense(name: "JEuclid", libraryName: "jeuclid-core-3.1.9.jar", version: "3.1.9", license: "Apache 2.0", url: "http://jeuclid.sourceforge.net", licenseUrl:"http://sourceforge.net/p/jeuclid/code/ci/default/tree/LICENSE.txt")
libraryLicense(name: "JGit", libraryName: "jackson", version: "2.5.1", license: "Apache 2.0", licenseUrl: "http://www.eclipse.org/org/documents/edl-v10.php", url: "https://github.com/FasterXML/jackson")
libraryLicense(name: "JGit", libraryName: "jgit", version: "4.0", license: "Eclipse Distribution License 1.0", licenseUrl: "http://www.eclipse.org/org/documents/edl-v10.php", url: "https://eclipse.org/jgit/")
@@ -279,7 +279,7 @@ libraryLicense(name: "Plexus Utils", libraryName: "plexus-utils-1.5.5.jar", vers
libraryLicense(name: "pockets", attachedTo: "python-helpers", version: "0.2.4", license: "BSD", url: "http://pockets.readthedocs.org/")
libraryLicense(name: "protobuf", version: "2.5.0", license: "New BSD", url: "http://code.google.com/p/protobuf/", licenseUrl: "https://github.com/google/protobuf/blob/master/LICENSE")
libraryLicense(name: "proxy-vole", libraryName: "proxy-vole", version: "20131209", license: "New BSD License", url: "http://code.google.com/p/proxy-vole/", licenseUrl: "http://opensource.org/licenses/BSD-3-Clause")
-libraryLicense(name: "pty4j", libraryName: "pty4j", version: "0.6", license: "Eclipse Public License v1.0", url: "https://github.com/traff/pty4j")
+libraryLicense(name: "pty4j", libraryName: "pty4j", version: "0.7", license: "Eclipse Public License v1.0", url: "https://github.com/traff/pty4j")
libraryLicense(name: "PureJavaComm", libraryName: "purejavacomm", version: "0.0.16", license: "BSD", url: "http://www.sparetimelabs.com/purejavacomm")
libraryLicense(name: "ReflectASM", libraryName: "reflectasm-1.0.7.jar", version: "1.0.7", license: "BSD", url: "https://github.com/EsotericSoftware/reflectasm", licenseUrl: "http://opensource.org/licenses/BSD-3-Clause")
libraryLicense(name: "Relax NG Object Model", libraryName: "rngom-20051226-patched.jar", license: "MIT", url: "http://java.net/projects/rngom/", licenseUrl: "http://www.opensource.org/licenses/mit-license.php")
diff --git a/lib/libpty/readme.txt b/lib/libpty/readme.txt
index c7d91b0105fb..1c1154f29a85 100644
--- a/lib/libpty/readme.txt
+++ b/lib/libpty/readme.txt
@@ -2,4 +2,4 @@
* cyglaunch.exe is a part of pty4j library licensed under Eclipse Public License and is linked with Cygwin™ according to Cygwin™ Open Source
Licensing Exception (see https://cygwin.com/licensing.html)
* purejavacomm - we use forked version that fixes JNA and YourKit Profiler incompatibility - https://github.com/traff/purejavacomm
-* libwinpty.dll and winpty-agent.exe - Windows PTY native implementation used by pty4j, we use forked version from https://github.com/traff/winpty
\ No newline at end of file
+* winpty.dll and winpty-agent.exe - Windows PTY native implementation used by pty4j - https://github.com/rprichard/winpty
\ No newline at end of file
diff --git a/lib/libpty/win/x86_64/libwinpty.dll b/lib/libpty/win/x86_64/libwinpty.dll
deleted file mode 100644
index 519ca8135a54..000000000000
Binary files a/lib/libpty/win/x86_64/libwinpty.dll and /dev/null differ
diff --git a/lib/libpty/win/x86_64/winpty-agent.exe b/lib/libpty/win/x86_64/winpty-agent.exe
index 8ebae382251d..e1963c4e3c85 100644
Binary files a/lib/libpty/win/x86_64/winpty-agent.exe and b/lib/libpty/win/x86_64/winpty-agent.exe differ
diff --git a/lib/libpty/win/x86_64/winpty.dll b/lib/libpty/win/x86_64/winpty.dll
new file mode 100644
index 000000000000..f9bdec0394fa
Binary files /dev/null and b/lib/libpty/win/x86_64/winpty.dll differ
diff --git a/lib/pty4j-0.6.jar b/lib/pty4j-0.7.jar
similarity index 55%
rename from lib/pty4j-0.6.jar
rename to lib/pty4j-0.7.jar
index c49d42a0889d..0c3d34a793f4 100644
Binary files a/lib/pty4j-0.6.jar and b/lib/pty4j-0.7.jar differ
diff --git a/lib/required_for_dist.txt b/lib/required_for_dist.txt
index 26c4c93a8fdb..71871c4c3d1a 100644
--- a/lib/required_for_dist.txt
+++ b/lib/required_for_dist.txt
@@ -57,7 +57,7 @@ oromatcher.jar
picocontainer.jar
protobuf-2.5.0.jar
proxy-vole_20131209.jar
-pty4j-0.6.jar
+pty4j-0.7.jar
purejavacomm.jar
resolver.jar
rhino-js-1_7R4.jar
diff --git a/lib/src/pty4j-0.6-src.jar b/lib/src/pty4j-0.7-src.jar
similarity index 58%
rename from lib/src/pty4j-0.6-src.jar
rename to lib/src/pty4j-0.7-src.jar
index 93241bdada53..cd45a7ab5c58 100644
Binary files a/lib/src/pty4j-0.6-src.jar and b/lib/src/pty4j-0.7-src.jar differ
diff --git a/plugins/terminal/lib/jediterm-pty-2.1.jar b/plugins/terminal/lib/jediterm-pty-2.2.jar
similarity index 66%
rename from plugins/terminal/lib/jediterm-pty-2.1.jar
rename to plugins/terminal/lib/jediterm-pty-2.2.jar
index bef8585e0e76..a1f211ba05dd 100644
Binary files a/plugins/terminal/lib/jediterm-pty-2.1.jar and b/plugins/terminal/lib/jediterm-pty-2.2.jar differ
diff --git a/plugins/terminal/terminal.iml b/plugins/terminal/terminal.iml
index 68385590f6c7..b173ddc26343 100644
--- a/plugins/terminal/terminal.iml
+++ b/plugins/terminal/terminal.iml
@@ -13,7 +13,7 @@
-
+