本节的翻译还未完成。在未完成之前,所有的未完成部分都将使用英语原文。

terminal-icon_64.png终端

桌面栏:应用程序
位置:/boot/system/apps/Terminal
设置:~/config/settings/Terminal
~/config/settings/profile - 添加或者覆盖默认的 /boot/system/settings/etc/profile
~/config/settings/inputrc - 添加或者覆盖默认的 /boot/system/settings/etc/inputrc


终端是Haiku中具有用户界面的bash,即 Bourne Again Shell。

请参考 脚本 这一主题获取有关 Shel l的在线教程,同时也可以阅读 Haiku 的命令行程序。在本文中,我们重点关注终端本身的使用。

index 窗口与标签

您可以根据需要打开任意数量的终端,可以简单的启动,或者从正在运行的终端中使用 ALT N 组合键来打开多个终端窗口。您也可以使用终端的标签视图方式,使用 ALT T 组合键打开新的终端标签。

terminal.png

双击标签栏的空白区域将打开一个新标签;双击标签将会打开一个对话框重命名标签标题。当您在文本域中悬停鼠标时,会有几个 %-指定变量 ,并且伴随着一个提示框,解释其含义。
默认情况下,%1d: %p,标签显示了当前目录和当前运行进程的名称,并且它们被 :所分隔(或者 --,如果它仅仅是一个运行的 bash ,或者空闲进程)。上面的屏幕截图中的第一个标签显示了 Desktop 文件夹中的 FTP 会话,而第二个标签闲置于 home 文件夹。
使用 Edit|Window title... 也可以以类似的方式编辑终端窗口的标题。

右键点击标签将会出现一个右键菜单:关闭标签关闭其他标签 或者,如双击,则显示 编辑标签主题...

终端的窗口和其他窗口一样可以调整尺寸,或者使用 设置 | 窗口大小 菜单中的预置尺寸。ALT ENTER 组合键将会切换到全屏模式。

所有直接通过 Settings 菜单修改的设置,例如 窗口标题窗口大小文本编码 或者 字体大小 仅对当前会话有效。 如果您希望永久保存这些改动,您可以通过 设置... 面板应用这些设置。

index 设置

Settings | Settings... 打开一个面板,用于配置终端的标准设置。

terminal-settings.png

Most of the offered settings speak for themselves.
Hover your mouse over the "formulas" for naming tab and window titles to get tooltips for the available variables.
You can choose pre-defined color schema like Midnight or Retro or create a Custom one by selecting which color you want to change (Text, Background, Cursor etc.) and then use the color picker below.

A few more options follow: you can have a Blinking cursor and choose to Use bright instead of bold text. The latter setting avoids the sometimes rather unsightly rendering of bold fonts in the Terminal.
Activate the checkbox to Confirm exit if active programs exist and you'll be warned when trying to close a Terminal window while an app is still being executed.

保存为... let's you save different settings as separate profiles, which on double-click open an accordingly configured Terminal.
取消 brings back the settings that were active when you opened the settings panel.
Defaults 重置所有设置未默认值。

index 快捷键

您可以在 快捷键和组合键 主题中找到非常有用的快捷键的列表。

Another nice feature that is more a key & mouse combination: When holding ALT a path or URL under the mouse pointer gets highlighted. A left-click opens the file/folder or website. A right-click opens a context menu to either Copy path or Copy absolute path. Imagine you're in /MyData/source/haiku/ and have the path generated/objects/haiku/x86_gcc2/release/apps/stylededit/StyledEdit under the mouse pointer, the latter menu item will result in the combined, absolute path <deep breath>:
/MyData/source/haiku/generated/objects/haiku/x86_gcc2/release/apps/stylededit/StyledEdit.

如果您同时按下 ALT SHIFT 按键,那么只有鼠标移动起始位置之间的部分会被高亮显示。

提示一下,右键点击终端窗口,将会插入剪贴板内容。通过和拷贝高亮路径部分组合,该方法可用于快速导航到深层次目录。

index Bash的定制

bash 来自于 Unix,它具有无数的可定制的方式。对于用户来讲,有两个文件至关重要: profileinputrc
这两个文件可以在 /boot/home/config/settings/ 文件夹中予以创建, 然后将会添加到或者覆盖在 /boot/system/settings/etc/ 中系统默认定义的配置文件。

profile

在您每次打开新的终端时, profile 都会被载入程序。在该文件中,设置了所有影响到 bash 行为和外观的各种类型的设备接口和变量。你可以在网络上找到许多资源,它们将会给出所有可能性的详细介绍。

Haiku/BeOS Tip Server 提供了许多入门的技巧,例如:

还有很多类似的信息,请参阅

inputrc

inputrc 用于处理键盘关联的配置。由于Haiku默认提供了非常有用的配置,您不需要修改相关的设置。如果您确实有特殊的需要,可以参考许多在线的资源,例如 GNU 的命令行读取库

index 关于终端的提醒