<p>Please refer to the topic on <ahref="../bash-scripting.html">Scripting</a> for a few links to online tutorials on working in the shell and also have a look at <ahref="cli-apps.html">Haiku's commandline applications</a>. Here, we'll concentrate on the Terminal application itself.</p>
<aid="windows-tabs"name="windows-tabs">Windows and tabs</a></h2>
<p>You can open as many Terminals as needed, either each in it's own window by simply launching more Terminals or with <spanclass="key">ALT</span><spanclass="key">N</span> from an already running Terminal. Or you use Terminal's tabbed view and open more tabs with <spanclass="key">ALT</span><spanclass="key">T</span>.</p>
<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 <spanclass="path">Desktop</span> folder and a second tab idling at <spanclass="path">home</span>.<br/>
<p>Right-clicking a tab shows a context menu to <spanclass="menu">Close tab</span>, <spanclass="menu">Close other tabs</span> or, like double-clicking, <spanclass="menu">Edit tab title...</span>.</p>
<p>A Terminal window can be resized like any other window or you use the presets from the <spanclass="menu">Settings | Window size</span> menu. <spanclass="key">ALT</span><spanclass="key">ENTER</span> toggles fullscreen mode.</p>
<p>Changed window size and text encoding are only kept choosing <spanclass="menu">Settings | Save as default</span>.</p>
<p>It starts off with the "formulas" for naming tab and window titles. Again, tooltips show the available variables. Below that you set font type, font size and the different text and background colors. You can choose a pre-defined color schema like <spanclass="menu">Black on white</span> or <spanclass="menu">White on black</span> or create a <spanclass="menu">Custom</span> one using the color picker below.<br/>
Activate the checkbox to <spanclass="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.<br/>
You can save different settings as separate profiles, which on double-click open an accordingly configured Terminal.<br/>
<p>Coming from Unix, there are countless possibilities to customize the bash itself. There are two files that are especially important to the user: <spanclass="cli">.profile</span> and <spanclass="cli">.inputrc</span><br/>
Both files can be created in the <spanclass="path">home/</span> folder and add or override the system defaults that are defined in <spanclass="path">/boot/common/etc/</span>.</p>
<p>The <spanclass="cli">.profile</span> is loaded every time you open a new Terminal. It sets all kinds of aliases and variables that will affect bash's behavior and appearance. You'll find many online resources that will detail all possibilities.</p>
<p>The <spanclass="cli">.inputrc</span> deals with keybindings. Since Haiku provides useful defaults, you probably don't have to mess with these more involved settings. If you do have special needs here, consult one of the many online resources, e.g. <ahref="http://tiswww.case.edu/php/chet/readline/rluserman.html">The GNU Readline Library</a>.</p>
<ul><li><p>Dragging a file or folder from a Tracker window into the Terminal will insert its path at the location of the cursor. Dragging with the right mouse button offers additional actions in a context menu:</p>
<tr><td><spanclass="menu">Insert path</span></td><td></td><td>Inserts the location of the file, same as drag&dropping with the left mouse button.</td></tr>
<tr><td><spanclass="menu">Change directory</span></td><td></td><td>Changes to the folder of the dragged file.</td></tr>
<tr><td><spanclass="menu">Create link here</span></td><td></td><td>Creates a link to the dragged file in the current working directory of the Terminal.</td></tr>
<tr><td><spanclass="menu">Move here</span></td><td></td><td>Moves the dragged file into the current working directory of the Terminal.</td></tr>
<tr><td><spanclass="menu">Copy here</span></td><td></td><td>Copies the dragged file into the current working directory of the Terminal.</td></tr>
<li><p>You can open any file with its preferred application with the command <spanclass="cli">open <i>[filename]</i></span>. This also works with the representation of the current ("<spanclass="cli">.</span>") and parent ("<spanclass="cli">..</span>") folder which then open in a Tracker window. So, to open the current working directory, you type:</p>