# 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.

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

Back to index
Back to tf home page

Copyright © 2002, 2003, 2004 Ken Keys