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

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

问题描述

是否有类似于 Mac OS 的在此处打开命令窗口"Windows Powertoy 的东西?我通过谷歌搜索找到了几个插件,但想看看哪些插件最适合开发者.

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 开始,Terminal 完全包含此功能即服务.与大多数服务一样,这些服务在默认情况下处于禁用状态,因此您需要启用它才能使其显示在服务"菜单中.

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.

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

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 还有用于查找手册页的新服务:在终端中打开手册页在新的终端窗口中显示选定的手册页主题,搜索手册终端中的页面 对所选文本执行适当"操作.前者还理解手册页引用(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天全站免登陆