Table of Contents
Preferences
Every page of the Preferences dialog, each control on it, what it does, its default, and its key in hanshi.conf. The last sections describe the settings file itself.
1. The dialog
Open Preferences with Ctrl+Shift+P in the terminal, or with Preferences... in the terminal's menu (the right mouse button). The list at the left names the five pages: Window, Appearance, View, Programs and About Hanshi; click a name to show its page. Each control has a tooltip that tells what it does: rest the pointer on the control or on its label.
The dialog's controls are Xtk's. In a text field, Ctrl+Z undoes, and Ctrl+Shift+Z or Ctrl+Y redoes; a field draws a thin border while the pointer is over it. In a number field, Up and Down (and the mouse wheel) step from the number you typed, and Page Up and Page Down step by ten. A button or a check box acts only when you let go of the mouse button over it: move the pointer away first to take a click back.
| Button | What it does |
|---|---|
| Apply | Uses the choices now and keeps the dialog open. When the window theme changed, the dialog takes the new theme too. |
| Cancel | Closes the dialog and puts back what was there when it opened, also after Apply. Escape and closing the dialog's window do the same. |
| OK | Uses the choices, writes them to hanshi.conf for the next start, and closes the dialog. |
Every setting takes effect at once, in every tab, without a restart; the one exception is turning shell integration on, which works for shells that start after it. While the dialog is open, the programs in the terminals go on running and the terminals go on showing their output; only their keyboard and mouse wait until the dialog closes.
2. Window
| Control | What it does | Default | Key |
|---|---|---|---|
| Theme > Window | The window theme: the colors of the scrollbar, the menu, the tabs and the dialogs. The list has the themes of ~/.config/hanshi/themes and the installed ones (Themes); it is made when Hanshi starts. A theme that is not there gives Dark. |
Dark | window-theme |
| Theme > Icons | The icons of Hanshi's menus: "As every xtk program" (the next setting), "The desktop's" icon theme, "Hanshi's own icons" (one-color, in the window theme's colors), or one of the installed icon themes (/usr/share/icons, ~/.local/share/icons). A theme's icons are drawn in its own colors, as GTK programs show them; a disabled menu item's in grey and faint. When the theme has no icon for something, Hanshi draws its own. |
As every xtk program | icon-theme (empty, desktop, builtin or a theme's folder name) |
| Theme > Icons of all xtk programs | The icons of every program built on xtk that does not choose its own (Hanshi, Unryu, Palette, Gamut, Skein, PixelPrism): "The desktop's" icon theme, "xtk's own icons", or one of the installed icon themes. The desktop's is the one your desktop announces (XSETTINGS), else the one in GTK's settings.ini or ~/.gtkrc-2.0, else KDE's; Hanshi follows a change of it while it runs. This setting is kept in ~/.config/xtk/icons.conf, and the other programs follow it too. |
The desktop's | (theme in ~/.config/xtk/icons.conf) |
| Size at the start > Rows | How many lines of text a new window shows, 1 to 500. | 24 | rows |
| Size at the start > Columns | How many characters wide a new window is, 2 to 1000. | 80 | columns |
| Remember the window's size | When Hanshi ends, it keeps the window's rows and columns as Rows and Columns, for the next window. A size given with -r or -c is not kept. |
off | remember-size |
| Tabs > More than one terminal in the window, in tabs | Lets the window hold more than one terminal, each in a tab (The Window and Tabs). Off: one terminal in the window, New Tab and Close Tab are grey, and the keys of the tabs go to the program. | on | tabs |
3. Appearance
| Control | What it does | Default | Key |
|---|---|---|---|
| Theme > Colors | Where the terminal's colors come from. "As the window theme": the terminal takes the colors of the window theme's text view (background, text, selection, cursor), and the rest is made from those, so the terminal matches the dialogs. Hosho Dark, Hosho Light, Sumi or Washi: one of the four built-in terminal themes. "A theme file": your own file, named in the next field. | Hosho Dark | terminal-theme: window, a theme's name, or file |
| Theme > Theme file | Used when Colors is "A theme file". A full path, a path that starts with ~/, or a file name in Hanshi's settings folder (~/.config/hanshi). The file is read again whenever it changes, so a change shows as soon as you save it. A file that cannot be read gives Hosho Dark. |
empty | terminal-theme-file |
| Font > Family | The terminal's font. The list has every font family installed. "Default" uses the terminal theme's font (monospace in the built-in themes). Choose a monospaced font: each character gets the width of the letter M. |
Default | font-family (empty for Default) |
| Font > Size | The font size in pixels, up to 96. 0 uses the terminal theme's size (14 in the built-in themes). Ctrl+Plus and Ctrl+Minus change the size of one terminal for a while. |
0 | font-size |
| Font > Line spacing | Extra pixels between lines of text, 0 to 40, half above and half below the text. | 0 | line-spacing |
| Ligatures | Draws sequences such as -> and != as one symbol, when the font has such ligatures. Joined letter forms (Arabic) and emoji made of several characters are drawn either way. |
on | ligatures |
| Bold text in bright colors | Shows bold text of the colors 0 to 7 in their bright versions (8 to 15), the way older terminals did. | off | bold-bright |
| Cursor > Shape | Block, Underline or Bar. A program can choose its own shape while it runs, as vim does in insert mode; a reset gives back this one. | Block | cursor-shape: block, underline, bar |
| Cursor > Blink | Blinks the cursor while the terminal has the keyboard (0.6 seconds on, 0.6 off). A program can switch the blink on and off itself. | off | cursor-blink |
4. View
| Control | What it does | Default | Key |
|---|---|---|---|
| Margins > Padding | Pixels of empty space between the window's edge and the text, 0 to 100. | 4 | padding |
| Margins > Prompt mark margin | The width in pixels of the margin at the left for the marks of shell integration, 0 to 40: green after a command that succeeded, red after one that failed. Click a mark to select that command's output; double-click it to hide the output. 0: no margin. With shell integration off there is no margin, whatever this says. | 6 | gutter-width |
| Scrollback > Lines | How many lines of earlier output are kept to scroll back through, 0 to 1,000,000. A change keeps the newest lines; the view goes back to the bottom. | 10000 | scrollback-lines |
| Colors > Minimum contrast | Lightens or darkens text that is hard to read on its background, such as dark blue on black, until the two have at least this contrast ratio (as WCAG measures it). 1 leaves colors alone, 4.5 is comfortable, 21 is the most. Text that is not a number from 1 to 21 keeps the value there was. | 1 | minimum-contrast |
| Background > Picture | A picture shown behind the text: a PNG, JPEG, GIF, BMP or XPM file, given as a full path or as a path that starts with ~/ (your home folder). It fills the view and keeps its shape: what does not fit is cut off at two sides. Empty: no picture. The picture is taken apart in the jail (Safety); without the jail it is not shown. The picture is read again when its file changes, so a picture you save again shows within a second or so. |
empty | background-image |
| Background > Tint | How strongly the background color covers the picture, in percent: 100 hides the picture, 0 shows it untouched. | 85 | background-opacity |
5. Programs
| Control | What it does | Default | Key |
|---|---|---|---|
| Shell > Command | The command a new terminal runs, as you would type it in a shell: /bin/sh -c runs it. Empty: your own shell. A program named on Hanshi's command line runs in the first tab in place of this. Shell integration is only for your own shell, not for a command here. While the command runs, closing its tab asks first (Safety, below), unless the command is a shell that waits at its prompt. |
empty | command (in [hanshi]) |
| Shell integration | Has your shell tell the terminal where each prompt and each command's output begins, and how each command ended (Shell Integration). It is needed for the prompt marks, hiding a command's output, the colors of the tabs and the long-command notice. Your own shell files are still read. Off hides the marks and stops the notice at once; on is for the shells that start after it. | on | shell-integration (in [hanshi]) |
| Notify after (seconds) | When a command that ran at least this long ends while you work in another window or another tab, the desktop shows a notification: "Command done" or "Command failed", with how long it ran and, for a failure, its status. 0 turns this off; so does shell integration off. Up to 86400. | 10 | notify-command-seconds |
| Keyboard and bell > Keyboard | Which keyboard the function keys and the keypad imitate: PC, VT220, Sun, HP, SCO, rxvt or Linux console. PC suits nearly everything; the others are for programs written for one of those terminals (Keyboard and Mouse). With Sun, HP, SCO, rxvt or Linux console, the programs of a terminal that starts after the change get that terminal's TERM, when its description is installed. |
PC | keyboard: pc, vt220, sun, hp, sco, rxvt, linux |
| Keyboard and bell > Bell | What happens when a program rings the bell: Sound (the X server's bell), Visual (a frame around the terminal in the cursor's color, for 0.15 seconds), Sound and visual, or None. Whatever the choice, a window without the keyboard asks for your attention (The Window and Tabs). | Sound | bell: sound, visual, both, none |
| Keyboard and bell > Answerback | Text the terminal sends back when a program sends the ENQ character, and when you press Ctrl+Break. Up to 63 bytes. Almost nothing uses this; leave it empty. |
empty | answerback |
| Safety > Ask before closing while a program runs | When you close the window or a tab while a program still runs in it, Hanshi asks first. A shell that waits at its prompt closes without a question. The command of Shell > Command counts as a program while it runs, also when it is a single program (The Window and Tabs). | on | confirm-close (in [hanshi]) |
| Safety > Confirm a paste of several lines | Before pasting several lines into a program that would run them at once, the terminal shows a question on its last line and waits for Enter (Using the Terminal). | on | paste-confirm |
| Safety > Programs can read the clipboard | Lets programs in the terminal read what you last copied (OSC 52). This includes programs on other machines over ssh. Off is safer. | off | clipboard-read |
| Safety > Programs can set the clipboard | Lets programs in the terminal put text on the clipboard (OSC 52), as tmux and vim can do over ssh. | off | clipboard-write |
| Safety > Programs can move and size the window | Lets programs in the terminal move, size, raise and iconify the window, change its number of rows and columns, and read its title and position. Off is safer. The size of the text area and of a character is always told to a program that asks. | off | window-ops |
| Output > Log file | A file that gets everything programs show, added at its end. A full path, or a path that starts with ~/ (your home folder). Each terminal writes to it from the moment it starts, or from the moment you name the file. Empty: no log. |
empty | log-file |
| Output > Print command | A shell command that receives what a program sends to the printer, on its standard input, for example lpr. It runs when the print job ends. Empty: the terminal tells programs that it has no printer. |
empty | print-command |
6. About Hanshi
The last page of the list shows Hanshi's logo, Hanshi's version and the versions of Hosho and Xtk it was built with, the copyright, the license (Artistic License 2.0) and the project's address. Nothing on it is a setting. hanshi -v prints the same versions in a terminal.
7. The settings file
The settings are kept in ~/.config/hanshi/hanshi.conf (or in $XDG_CONFIG_HOME/hanshi when that variable is a full path). The file has two sections, and each key has a line above it that says what it is:
[hanshi]has Hanshi's own settings:window-theme,icon-theme,terminal-theme,terminal-theme-file,rows,columns,remember-size,command,shell-integration,confirm-closeandtabs. A switch is1for on and0for off.[terminal-widget]has the terminal's settings, with the keys and values of a terminal theme's[terminal-widget]section (Themes). An emptyfont-familyand afont-sizeof 0 mean the terminal theme's font.
[hanshi]
; The window theme, by name: the scrollbar, the menu, the dialogs.
window-theme = Dark
terminal-theme = Hosho Dark
rows = 24
columns = 80
...
[terminal-widget]
font-family =
font-size = 0
cursor-shape = block
...
- Hanshi reads the file when it starts. A key the file does not have gets its default; a value that is not correct (a row count above 500, a word where a number belongs) is ignored and the key keeps its default.
- Hanshi writes the whole file when Preferences closes with OK, and when it ends while "Remember the window's size" is on and the size changed. It writes a new file beside the old one first and then puts it in the old one's place, so a write that fails leaves the old file whole.
- You can change the file by hand while Hanshi does not run. A Hanshi that runs does not see the change, and writes its own settings over it at the next OK.
- The settings of Preferences are over the settings of the terminal theme: whatever a theme file's own
[terminal-widget]section says, the cursor, the padding, the scrollback and the other settings are those of Preferences. Only the font is the theme's, when Preferences names none.