Terminalen
Deskbar: | ||
Plats: | /boot/system/apps/Terminal | |
Inställningar: | ~/config/settings/Terminal ~/.profile - adds/overrides defaults in /boot/common/etc/profile ~/.inputrc - adds/overrides defaults in /boot/common/etc/inputrc |
Terminalen är Haiku's gränssnitt till Bash (Bourne Again Shell), skalet som Haiku använder.
Please refer to the topic on Scripting for a few links to online tutorials on working in the shell and also have a look at Haiku's commandline applications. Here, we'll concentrate on the Terminal application itself.
Fönster och flikar
You can open as many Terminals as needed, either each in it's own window by simply launching more Terminals or with ALT N from an already running Terminal. Or you use Terminal's tabbed view and open more tabs with ALT T.
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.
By default, %1d: %p, a tab shows the current directory and, separated by a :, the name of the currently running process (or -- if it's just bash running, probably idling). The screenshot above shows the first tab with a FTP session in the Desktop folder and a second tab idling at home.
Via the Terminal window's title can be edited in a similar way.
Right-clicking a tab shows a context menu to
, or, like double-clicking, .A Terminal window can be resized like any other window or you use the presets from the ALT ENTER toggles fullscreen mode.
menu.Changed window size and text encoding are only kept choosing
.Inställningar
opens a panel to configure the standard settings of a Terminal.
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
Activate the checkbox to and you'll be warned when trying to close a Terminal window while an app is still being executed.
You can save different settings as separate profiles, which on double-click open an accordingly configured Terminal.
Pressing will save the current settings as default.
Kortkommandon
Det finns en användbar lista över kortkommandon i kapitlet Kortkommandon och tangentkombinationer.
Anpassa skalet
Coming from Unix, there are countless possibilities to customize the bash itself. There are two files that are especially important to the user: .profile and .inputrc
Both files can be created in the home/ folder and add or override the system defaults that are defined in /boot/common/etc/.
Filen .profile
The .profile 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.
The Haiku/BeOS Tip Server has quite a few tips to get you started, for example:
There are more, have a look.
Filen .inputrc
The .inputrc 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. The GNU Readline Library.
Tips vid användning av Terminalen
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:
Inserts the location of the file, same as drag&dropping with the left mouse button. Changes to the folder of the dragged file. Creates a link to the dragged file in the current working directory of the Terminal. Moves the dragged file into the current working directory of the Terminal. Copies the dragged file into the current working directory of the Terminal. You can open any file with its preferred application with the command open [filename]. This also works with the representation of the current (".") and parent ("..") folder which then open in a Tracker window. So, to open the current working directory, you type:
open .