haiku/docs/userguide/zh_CN/applications/terminal.html
2020-05-30 10:43:56 +01:00

167 lines
13 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN" xml:lang="zh-CN">
<head>
<!--
*
* Copyright 2008-2020, Haiku. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Humdinger <humdingerb@gmail.com>
* Translators:
* Humdinger
* Pengphei Han
*
-->
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="robots" content="all" />
<title>终端</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="../../Haiku-doc.css" />
</head>
<body>
<div id="banner">
<div><span>User guide</span></div>
</div>
<div class="nav">
<div class="inner">
<ul class="lang-menu">
<li class="now"> 中文 [中文]&nbsp;<span class="dropdown-caret">&#9660;</span></li>
<li><a href="../../id/applications/terminal.html">Bahasa Indonesia</a></li>
<li><a href="../../ca/applications/terminal.html">Català</a></li>
<li><a href="../../de/applications/terminal.html">Deutsch</a></li>
<li><a href="../../en/applications/terminal.html">English</a></li>
<li><a href="../../es/applications/terminal.html">Español</a></li>
<li><a href="../../fr/applications/terminal.html">Français</a></li>
<li><a href="../../fur/applications/terminal.html">Furlan</a></li>
<li><a href="../../it/applications/terminal.html">Italiano</a></li>
<li><a href="../../hu/applications/terminal.html">Magyar</a></li>
<li><a href="../../pl/applications/terminal.html">Polski</a></li>
<li><a href="../../pt_PT/applications/terminal.html">Português</a></li>
<li><a href="../../pt_BR/applications/terminal.html">Português (Brazil)</a></li>
<li><a href="../../ro/applications/terminal.html">Română</a></li>
<li><a href="../../sk/applications/terminal.html">Slovenčina</a></li>
<li><a href="../../fi/applications/terminal.html">Suomi</a></li>
<li><a href="../../sv_SE/applications/terminal.html">Svenska</a></li>
<li><a href="../../tr/applications/terminal.html">Türkçe</a></li>
<li><a href="../../ru/applications/terminal.html">Русский</a></li>
<li><a href="../../uk/applications/terminal.html">Українська</a></li>
<li><a href="../../jp/applications/terminal.html">日本語</a></li>
</ul>
<span>
« <a href="stylededit.html">StyledEdit</a>
:: <a href="../applications.html#list-of-apps" class="uplink">应用程序
</a>
:: <a href="textsearch.html">TextSearch</a> »
</span></div>
</div>
<div id="content">
<div>
<div class="box-info">The translation of this page isn't yet complete. Until it is, unfinished parts use the English original.</div>
<h2><img src="../../images/apps-images/terminal-icon_64.png" alt="terminal-icon_64.png" width="64" height="64" />终端</h2>
<table summary="layout" border="0" cellspacing="0" cellpadding="2">
<tr><td>桌面栏:</td><td style="width:15px;"></td><td><span class="menu">应用程序</span></td></tr>
<tr><td>位置:</td><td></td><td><span class="path">/boot/system/apps/Terminal</span></td></tr>
<tr><td>设置:</td><td></td><td><span class="path">~/config/settings/Terminal</span><br />
<span class="path">~/config/settings/profile</span> - 添加或者覆盖默认的 <span class="path">/boot/system/settings/etc/profile</span><br />
<span class="path">~/config/settings/inputrc</span> - 添加或者覆盖默认的 <span class="path">/boot/system/settings/etc/inputrc</span></td></tr>
</table>
<p><br /></p>
<p>终端是Haiku中具有用户界面的bash即 Bourne Again Shell。</p>
<p>请参考 <a href="../bash-scripting.html">脚本</a> 这一主题获取有关 Shel l的在线教程同时也可以阅读 <a href="cli-apps.html">Haiku 的命令行程序</a>。在本文中,我们重点关注终端本身的使用。</p>
<h2>
<a href="#"><img src="../../images/up.png" style="border:none;float:right" alt="index" /></a>
<a id="windows-tabs" name="windows-tabs">窗口与标签</a></h2>
<p>您可以根据需要打开任意数量的终端,可以简单的启动,或者从正在运行的终端中使用 <span class="key">ALT</span> <span class="key">N</span> 组合键来打开多个终端窗口。您也可以使用终端的标签视图方式,使用 <span class="key">ALT</span> <span class="key">T</span> 组合键打开新的终端标签。</p>
<img src="../images/apps-images/terminal.png" alt="terminal.png" />
<br />
<p>Double-clicking into the emtpy part of the tab bar opens a new tab; onto a tab opens a dialog to rename its title. There are several %-designated variables that are explained with a tooltip when you hover the mouse over the text field.<br />
By default, <tt>%1d: %p</tt>, a tab shows the current directory and, separated by a <tt>:</tt>, the name of the currently running process (or <tt>--</tt> if it's just bash running, probably idling). The screenshot above shows the first tab with a FTP session in the <span class="path">Desktop</span> folder and a second tab idling at <span class="path">home</span>.<br />
Via <span class="menu">Settings | Window title...</span> the Terminal window's title can be edited in a similar way.</p>
<p>右键点击标签将会出现一个右键菜单:<span class="menu">关闭标签</span><span class="menu">关闭其他标签</span> 或者,如双击,则显示<span class="menu"> 编辑标签主题...</span></p>
<p>终端的窗口和其他窗口一样可以调整尺寸,或者使用 <span class="menu">设置 | 窗口大小</span> 菜单中的预置尺寸。<span class="key">ALT</span> <span class="key">ENTER</span> 组合键将会切换到全屏模式。</p>
<p>所有直接通过 <span class="menu">Settings</span> 菜单修改的设置,例如 <span class="menu">窗口标题</span> <span class="menu">窗口大小</span> <span class="menu">文本编码</span> 或者 <span class="menu">字体大小</span> 仅对当前会话有效。 如果您希望永久保存这些改动,您可以通过 <span class="menu">设置...</span> 面板应用这些设置。</p>
<h2><a href="#"><img src="../../images/up.png" style="border:none;float:right" alt="index" /></a>
<a id="settings" name="settings">设置</a></h2>
<p><span class="menu">Settings | Settings...</span> 打开一个面板,用于配置终端的标准设置。</p>
<img src="../images/apps-images/terminal-settings.png" alt="terminal-settings.png" />
<br />
<p>Most of the offered settings speak for themselves. Not entirely obvious though, the font size is set in the submenu of the <span class="menu">Font</span> popup menu.<br />
Hover your mouse over the "formulas" for naming tab and window titles to get tooltips for the available variables. <br />
You can choose pre-defined color schema like <span class="menu">Midnight</span> or <span class="menu">Retro</span> or create a <span class="menu">Custom</span> one by selecting which color you want to change (<span class="menu">Text</span>, <span class="menu">Background</span>, <span class="menu">Cursor</span> etc.) and then use the color picker below.</p>
<p>A few more options follow: you can have a <span class="menu">Blinking cursor</span> and choose to <span class="menu">Allow bold text</span>.<br />
<span class="menu">Use left Option as Meta key</span> if you work with certain UNIX software that relies on accessing an extended portion of the ASCII character set, like e.g. GNU Emacs and the GNU readline library.<br />
Activate the checkbox to <span class="menu">Confirm exit if active programs exist</span> and you'll be warned when trying to close a Terminal window while an app is still being executed.</p>
<table summary="layout" border="0" cellpadding="2" cellspacing="0">
<tr><td class="onelinetop"><span class="button">保存为...</span></td><td width="10"> </td><td>让您可以将不同的设置保存为独立文件,基于此,双击之后可以打看对应配置文件的终端窗口。</td></tr>
<tr><td><span class="button">取消</span></td><td> </td><td>撤销设置为最近打开设置面板时的状态。</td></tr>
<tr><td><span class="button">Defaults</span></td><td> </td><td>重置所有设置未默认值。</td></tr>
</table>
<h2>
<a href="#"><img src="../../images/up.png" style="border:none;float:right" alt="index" /></a>
<a id="shortcuts" name="shortcuts">键盘快捷键</a></h2>
<p>您可以在 <a href="../keyboard-shortcuts.html#terminal">快捷键和组合键</a> 主题中找到非常有用的快捷键的列表。</p>
<p>Another nice feature that is more a key &amp; mouse combination: When holding <span class="key">ALT</span> 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 <span class="menu">Copy path</span> or <span class="menu">Copy absolute path</span>. Imagine you're in <span class="path">/MyData/source/haiku/</span> and have the path <span class="path">generated/objects/haiku/x86_gcc2/release/apps/stylededit/StyledEdit</span> under the mouse pointer, the latter menu item will result in the combined, absolute path &lt;<i>deep breath</i>&gt;:<br /> <span class="path">/MyData/source/haiku/generated/objects/haiku/x86_gcc2/release/apps/stylededit/StyledEdit</span>.</p>
<p>如果您同时按下 <span class="key">ALT</span> <span class="key">SHIFT</span> 按键,那么只有鼠标移动起始位置之间的部分会被高亮显示。 </p>
<p>提示一下,右键点击终端窗口,将会插入剪贴板内容。通过和拷贝高亮路径部分组合,该方法可用于快速导航到深层次目录。</p>
<h2>
<a href="#"><img src="../../images/up.png" style="border:none;float:right" alt="index" /></a>
<a id="customization" name="customization">Bash的定制</a></h2>
<p>bash 来自于 Unix它具有无数的可定制的方式。对于用户来讲有两个文件至关重要 <span class="cli">profile</span><span class="cli">inputrc</span>
<br />
这两个文件可以在 <span class="path">/boot/home/config/settings/</span> 文件夹中予以创建, 然后将会添加到或者覆盖在 <span class="path">/boot/system/settings/etc/</span> 中系统默认定义的配置文件。</p>
<h3>profile</h3>
<p>在您每次打开新的终端时, <span class="cli">profile</span> 都会被载入程序。在该文件中,设置了所有影响到 bash 行为和外观的各种类型的设备接口和变量。你可以在网络上找到许多资源,它们将会给出所有可能性的详细介绍。</p>
<p>Haiku/BeOS Tip Server 提供了许多入门的技巧,例如:</p>
<ul>
<li><a href="https://betips.net/?p=5">Customize your Terminal prompt</a></li>
<li><a href="https://betips.net/?p=66">More prompt customizations</a></li>
<li><a href="https://betips.net/?p=67">Enhancing bash</a></li>
<li><a href="https://betips.net/?p=105">Custom keyboard shortcuts</a></li>
</ul>
<p>There are more, <a href="https://betips.net/?s=profile">have a look</a>.</p>
<h3>inputrc</h3>
<p> <span class="cli">inputrc</span> 用于处理键盘关联的配置。由于Haiku默认提供了非常有用的配置您不需要修改相关的设置。如果您确实有特殊的需要可以参考许多在线的资源例如<a href="http://tiswww.case.edu/php/chet/readline/rluserman.html"> GNU 的命令行读取库</a></p>
<h2>
<a href="#"><img src="../../images/up.png" style="border:none;float:right" alt="index" /></a>
<a id="hints" name="hints">关于终端的提醒</a></h2>
<ul><li><p>从文件浏览器窗口中拖拽文件或者文件夹到终端将会在光标的位置插入它的路径。而使用右键拖拽将会弹出一个右键菜单,显示附加的操作:</p>
<table summary="layout" border="0" cellpadding="2" cellspacing="0">
<tr><td><span class="menu">插入路径</span></td><td> </td><td>插入一个文件的路径,与左键拖拽文件到终端类似。</td></tr>
<tr><td><span class="menu">切换目录</span></td><td> </td><td>切换到所拖拽文件所在的文件夹。</td></tr>
<tr><td><span class="menu">创建链接到这里</span></td><td> </td><td>在终端当前工作的目录为拖拽的文件创建链接。</td></tr>
<tr><td><span class="menu">移动到这里</span></td><td> </td><td>移动拖拽的文件到终端当前工作的目录。</td></tr>
<tr><td><span class="menu">复制到这里</span></td><td> </td><td>复制拖拽的文件到终端当期工作的目录。</td></tr>
</table></li>
<li><p>您可以使用<span class="cli">open <i>[filename]</i></span> 命令以首选程序打开任何的文件。该命令也作用于当前文件夹("<span class="cli">.</span>")和父文件夹("<span class="cli">..</span>"它们分别以Tracker窗口打开。所以如果希望打开当前工作的目录您可以输入</p>
<pre class="terminal">open .</pre>
</li></ul>
</div>
</div>
<div class="nav">
<div class="inner"><span>
« <a href="stylededit.html">StyledEdit</a>
:: <a href="../applications.html#list-of-apps" class="uplink">应用程序
</a>
:: <a href="textsearch.html">TextSearch</a> »
</span></div>
</div>
</body>
</html>