在Mac OS Finder中打开此处的终端 [英] Open terminal here in Mac OS finder

查看:366
本文介绍了在Mac OS Finder中打开此处的终端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在类似于Mac OS的Windows Powertoy的此处打开命令窗口"?我通过Google搜索找到了几个插件,但想了解最适合那里的开发人员的插件.

Is there something similar to the "Open Command Window Here" Windows Powertoy for Mac OS? I've found a couple plugins through a google search but wanted to see what works best for developers out there.

推荐答案

从Mac OS X Lion 10.7开始,终端完全包含此功能即服务.与大多数服务一样,这些功能默认情况下处于禁用状态,因此您需要启用它才能使其显示在服务"菜单中.

As of Mac OS X Lion 10.7, Terminal includes exactly this functionality as a Service. As with most Services, these are disabled by default, so you'll need to enable this to make it appear in the Services menu.

系统偏好设置>键盘>快捷方式>服务

System Preferences > Keyboard > Shortcuts > Services

启用文件夹中的新终端" .还有文件夹中的新终端标签" ,它将在最前面的终端"窗口中创建一个标签(如果有的话,否则将创建一个新窗口).这些服务不仅可以在Finder中使用,而且还可以在所有应用程序中使用,并且可以对文件夹以及文本中选择的绝对路径名进行操作.

Enable New Terminal at Folder. There's also New Terminal Tab at Folder, which will create a tab in the frontmost Terminal window (if any, else it will create a new window). These Services work in all applications, not just Finder, and they operate on folders as well as absolute pathnames selected in text.

您甚至可以为其分配命令键.

You can even assign command keys to them.

服务显示在每个应用程序菜单的服务"子菜单中,以及在上下文菜单中(在文件夹或路径名上按住Control键单击或右键单击).

Services appear in the Services submenu of each application menu, and within the contextual menu (Control-Click or Right-Click on a folder or pathname).

在文件夹中新建终端服务将在在Finder中选择文件夹时变为活动状态.您不能简单地打开文件夹并就地"运行服务.返回父文件夹,选择相关文件夹,然后通过服务"菜单或上下文菜单激活服务.

The New Terminal at Folder service will become active when you select a folder in Finder. You cannot simply have the folder open and run the service "in place". Go back to the parent folder, select the relevant folder, then activate the service via the Services menu or context menu.

此外,如果将文件夹(或路径名)拖到终端"应用程序图标上,Lion Terminal将打开一个新的终端窗口,也可以将其拖到现有窗口的标签栏上以创建新的标签.

In addition, Lion Terminal will open a new terminal window if you drag a folder (or pathname) onto the Terminal application icon, and you can also drag to the tab bar of an existing window to create a new tab.

最后,如果将文件夹或路径名拖到选项卡上(在选项卡栏中),并且前台进程是外壳程序,它将自动执行"cd"命令. (如在较早版本的Terminal中一样,进入选项卡中的终端视图只是插入路径名.)

Finally, if you drag a folder or pathname onto a tab (in the tab bar) and the foreground process is the shell, it will automatically execute a "cd" command. (Dragging into the terminal view within the tab merely inserts the pathname on its own, as in older versions of Terminal.)

您也可以从命令行或Shell脚本执行此操作:

You can also do this from the command line or a shell script:

open -a Terminal /path/to/folder

这等效于在命令行中将文件夹/路径名拖到终端"应用程序图标上.

This is the command-line equivalent of dragging a folder/pathname onto the Terminal application icon.

在相关说明中,Lion Terminal还具有用于查找手册页的新服务:在终端机中打开手册页在新的终端窗口中显示选定的手册页主题,并搜索手册页终端机中的页面对所选文本执行"apropos".前者还了解手册页引用("open(2)"),手册页命令行参数("2 open")和手册页URL("x-man-page://2/open").

On a related note, Lion Terminal also has new Services for looking up man pages: Open man page in Terminal displays the selected man page topic in a new terminal window, and Search man Pages in Terminal performs "apropos" on the selected text. The former also understands man page references ("open(2)"), man page command line arguments ("2 open") and man page URLs ("x-man-page://2/open").

这篇关于在Mac OS Finder中打开此处的终端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆