virtual windows

Starting in version 5.0, TF maintains a separate virtual window for each open socket, including the "(no world)" pseudo-socket. Normally, a window scrolls when text is written to it. If the more flag is set, automatic scrolling will stop when the window becomes full. You can manually scroll forwards and backwards in each socket's window using the keys in the table below.

Per-socket windows make it unnecessary to finish reading the text on one socket before switching to another. When you bring a new socket into the foreground, the old socket's window is hidden, but remembers all of its text and current position; when you return that old socket to the foreground, the text is redrawn at the remembered position, and you can resume reading where you left off. A dividing line makes it easy to find the point where the old text ends and the new text begins. The text of a window is also refilled after resuming from /suspend or /sh, and even when the terminal's size changes.

In the table below, the "/dokey" columns indicate the argument to the /dokey command that performs the scrolling, and the "keys" column indicates the default keystrokes that perform the scrolling.

    scroll       ....forward....   ...backward....
    amount       /dokey  keys      /dokey     keys
    -----------  ------- -------   ---------- ----
    normal       PgDn    PgDn      PgUp       PgUp
    1/2 screen   hpage   ^[h ^X]   hpageback  ^X[
    1 screen     page    TAB ^X}   pageback   ^X{
    1 line       line    ^[^N      lineback   ^[^P
Note that the line-scrolling keys may be typable as meta-ctrl-n and meta-ctrl-p (depending on your %meta_esc and locale). "Normal" scrolling is a full screenful by default. If you prefer PgUp and PgDn to scroll a half screen instead, you should redefine
    /def key_pgdn = /dokey_hpage
    /def key_pgup = /dokey_hpageback

Some terminal emulators do not send PgUp and PgDn keys to tf. If you have such a terminal, you may wish to

    /bind ^F = /dokey_page
    /bind ^B = /dokey_pageback
If you're an emacs user, you may want to bind
    /bind ^V = /dokey_page
    /bind ^[v = /dokey_pageback
(or, "/load kb-emacs.tf").

A virtual screen can be redrawn with ^L, or cleared with ^[^L (ESC ctrl-L). Once lines are cleared from a screen, they can be redrawn by scrolling back to them. They are not automatically redrawn when you hide the screen and then unhide it again.

Some hooks need to print messages that do not make sense at the bottom of the foreground window (as they did before version 5.0). For example, if you have world Foo in the foreground, and get activity in world Bar, it would not make sense for the ACTIVITY hook to print "% Activity in world Bar" to Foo's window. Firstly, you might want to know about the activity even if you are not at the end of Foo's window buffer. Secondly, after you read the text in Bar and returned to Foo, the message would still be at the bottom of Foo's window buffer, misleadingly. Many messages of this type are now delivered as "alerts". An alert appears temporarily on the status line, where you can see it immediately and it will not outlive its usefulness. Also, because text from different worlds is not mixed in 5.0, the WORLD hook no longer prints "--- World name ---".

The /limit command will filter the text displayed in a window. The counters in the more prompt will count only the lines that match the limit.

If your terminal emulator has its own scrollback, it probably will not work very well with tf. To avoid confusion and avoid polluting your terminal's scrollback with garbage, tf tries to switch to the terminal's "alternate buffer", which does not keep scrollback. But not all terminals and configurations allow this (for example, xterm does, but only if the termcap or terminfo entry contains the correct codes, and it has not been disabled with xterm's titeInhibit resource). If the terminal can not switch to an alternate buffer, the terminal's scrollback may appear to work for a while, but will become jumbled as soon as you switch worlds in tf or use tf's scrollback. You are advised to not attempt to use your terminal's scrollback at all while running tf.

See also: interface, visual, /limit, keybindings.


Back to index
Back to tf home page
Copyright © 2002, 2003, 2004, 2005, 2006-2007 Ken Keys