本文介绍了从iTerm 2在IntelliJ上打开文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的iTerm中有如下输出:

I have output in my iTerm like:

  File project/path/path/file.py:56:54 extra text information

如何单击即可在IntelliJ中打开此文件?

How I can open this file in IntelliJ with a single click?

推荐答案

IntelliJ具有命令行功能,您可以在此处查看:

IntelliJ has a command line features that you can check out here:

https: //www.jetbrains.com/help/idea/2016.2/working-with-intellij-idea-features-from-command-line.html

当我们在文件路径模式上使用cmd and click时,iTerm还可以启动命令行命令.

iTerm as well enable launch a command line order when we use cmd and click over a file path pattern.

您只需要转到iTerm首选项,配置文件,高级,语义历史记录

You only have to go to iTerm Preferences, Profiles, Advanced, Semantic History

在语义历史记录"中,选中运行命令.."并添加为命令:

In Semantic History check "Run Comand.." and add as a command:

/Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea  \1 --line \2

IntelliJ必须在当前项目中.您可以执行一个项目:

IntelliJ has to be in the current project. You can enforce a project:

/Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea <project_path> \1 --line \2

或使用\5作为项目路径,\5是当前终端目录中的密码.

or event use \5 as a project path, \5 is a pwd in the current terminal directory.

在第一种配置下,我得到了更好的结果.

I had better results with the first configuration.

注意:我使用的是IntelliJ Idea 2019.1:/Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea --line \2 \1

Note: with IntelliJ Idea 2019.1 i used: /Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea --line \2 \1

我转到pycharm,目前正在使用以下行:

I move to pycharm, and I am currently using this line:

/Applications/PyCharm.app/Contents/MacOS/pycharm  \1 --line \2

这篇关于从iTerm 2在IntelliJ上打开文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 15:29