Table of Contents

Name

twander - File Browser

Overview

Wander around a filesystem executing commands of your choice on selected files and directories. The general idea here is that provides GUI facilities for navigating around your filesystem, but you define the commands you want available via "Command Definitions" in the .

If you're new to and want to know why this program is better and different than whatever you're using at the moment, take a moment to read the section called DESIGN PHILOSOPHY toward the end of this document first.

Similarly, if this is the first time you've worked with , there is a section near the end of this document entitled INSTALLING which describes how the program should be installed.

You can get the latest version of the program and documentation from the homepage:


        http://www.tundraware.com/Software/twander/

You should check this site periodically for program updates, bug fixes, and enhacements.

Also, you are strongly encouraged to join the mailing list where you'll find help and answers to questions you have about this program. Details of how to do this can be found toward the end of this document in the section entitled, GETTING HELP: THE MAILING LIST.

Synopsis

twander [-cdhqrtv] [startdir]

Options

startdir
Directory in which to begin. (default: directory in which program was started)

If this directory does not exist or cannot be opened, will display an error message and abort.

-c path/name of
Specify the location and name of the configuration file. (default is ~/.twander)

If this file does not exist or cannot be opened, will display a warning to that effect but continue to run. This is reasonable behavior because provides a command to reload the without exiting the program (which you would presumably do after fixing the problem).

-d debuglevel
Start in debug mode dumping the items specified in the debuglevel. (default: debuglevel=0/debug off)

is able to selectively dump debugging information to stdout. 'debuglevel' is understood to be a bitfield in which each bit specifies some kind of debugging information or behavior. 'debuglevel' can be specified in either decimal or hex (using the form 0x#) formats. The bits in the bitfield are defined as follows:


Bit  Hex Value   Meaning
---  ---------   -------
0    0x001       Dump Internal Options & User-Settable Options 
1    0x002       Dump User-Defined Variables 
2    0x004       Dump Command Definitions 
3    0x008       Dump Key Bindings 
4    0x010       Display, Do Not Execute, Commands When Invoked 
5    0x020       Dump Directory Stack As It Changes 
6    0x040       Dump Command History Stack After Command Executes 
7    0x080       Dump Contents Of Program Memories As They Change 
8    0x100       Dump Contents Of Wildcard Stack As It Changes
9    0x200       Reserved/Unused
10   0x400       Reserved/Unused
11   0x800       Dump Requested Debug Information And Exit Immediately

These bits can be combined to provided very specific debugging information. For example, '-d 0x80f' will dump (to stdout) all the Internal Options, User-Settable Options, User-Defined Options, Command Definitions, and Key Bindings and then terminate the program.

-h
Print help information on stdout.

-q
Quiet mode - suppresses warnings. (default: warnings on)

-r
Turn off automatic refreshing of directory display. (default: refresh on)

Normally re-reads and displays the current directory every few seconds to reflect any changes that might have occurred to that directory's contents. This option is useful on slow machines (or slow X connections) and/or when working with very large directories. In this situation, the frequent updating of the display can make the program unacceptably slow and unresponsive. In this case you can still force an update manually with the REFRESH function (default assignment is to the Control-l key).

-t
Turn off quoting when substituting built-in variables. (default: quoting on)

Anytime encounters a reference to one of the built-in variables which do string replacement (DIR, DSELECTION, DSELECTIONS, MEM1-12, PROMPT:, SELECTION, SELECTIONS) in a command, it will replace them with double quoted strings. This is necessary because any of these can return values which have embedded spaces in them. By quoting them, they can be passed to a command or script as a single item. The -t option disables this behavior and replaces the built-in variable with unquoted literals.

-v
Print detailed version information.

Other Ways to Set tw Options

In addition to these command line options, there are two other ways you can set program features. If you prefer, you can set the command line options via the environment variable, TWANDER. That way you don't have to type them in each time you start the program. Say you set the environment variable this way on Unix:


export TWANDER=-qt

From then on, every time you run the program, the -q and -t options would be invoked (No Quoting, No Warnings) just as if you had typed them in on the command line.

The second way to set these (and MANY more) Program Options is by setting the appropriate entries in the . This is covered later in this document.

evaluates options in the following order (from first to last:

This means, for example, that the environment variable overrides a corresponding setting in the , but the command line overrides the environment variable. Furthermore, there are many Program Options which can only be set/changed the and are not available in either the environment variable or on the command line.

This also means that options set on the command line are not read until after the has been processed. So, the -q argument on the command line will not inhibit warnings generated during the reading of the . This is best done by adding the statement, WARN=False, at the top of the Configuration File.

If the is reloaded while the program is running (see the READCONF key below), any options set in the file will have the last word. This allows you to edit the and have your changes reflected in a running instance of , but it also means that the environment variable/command line arguments are ignored after initial program startup.

Keyboard Use

By design, allows you to do almost everything of interest using only the keyboard. Various features are thus associated with particular keystrokes which are described below. It is also very simple to change the default key assignments with entries in the , also described below.

Notes on Keyboard Arrow/Keypad Behavior and Text Dialog Edits

Generally, the arrow and keypad keys should do what you would expect on the system in question. On Win32 systems, particularly, there ought to be no odd arrow/keypad behavior.

X-Windows is somewhat more problematic in this area. Just what an arrow key is "supposed" to do depends on how it's been mapped in your X server software. Testing on various X servers showed quite a bit of variability in how they handled the arrows and keypad. So ... if you're running in an X Windows universe and arrows or keypad do nothing, or do strange things, look into your key maps, don't blame .

There are several features of that will present the user a text entry dialog. These include the CHANGEDIR and RUNCMD features as well as the [PROMPT:...] Built-In Variable (all described below).

Any time you are entering text in such a dialog, be aware that the text can be edited several ways - You can edit it using the arrow/keypad editing assignments which are enabled/normal for your operating system, OR you can use emacs-style commands to edit the text. For instance, Control-a, Control-k will erase the text currently entered in the dialog.

Default Keyboard and Mouse Bindings

Here, ordered by category, are the default keyboard and mouse bindings for . The general format is:

Description (Program Function Name)
Default Key Assignment
Default Mouse Assignment (if any)

The "Program Function Name" is the internal variable uses to associate a particular feature with a particular keystroke or mouse action. You can ignore it unless you intend to override the default key assignments. This use is described below in the section entitled, Key Binding Statements.

It is important to realize that key-bindings are case-sensitive. This means that 'Control-b' and 'Control-B' are different. This was a conscious design decision because it effectively doubles the number of Control/Alt key combinations available for the addition of future features.

The default bindings chosen for features are all currently lower-case. If your program suddenly stops responding to keyboard commands, check to make sure you don't have CapsLock turned on.

NOTE: Some features are doubled on the mouse. These mouse button assignments are documented below for the sake of completeness. However, mouse button assignments cannot be changed by the user, even in the .

General Program Commands

This family of commands controls the operation of itself.

Clear History (CLRHIST)
Control-y

Clears out various program histories including the All Visited Directories list, the Directory Stack, the Command History, and the last manually-entered values for CHANGEDIR and RUNCMD. The 12 Program Memories are not cleared - they have specially dedicated key bindings for this purpose.

Decrement Font Size (FONTDECR)
Control-[

Decrease font size.

Increment Font Size (FONTINCR)
Control-]

Increase font size.

These two features allow you to change the display font sizes while is running. But, you may not immediately get the results you expect. internally keeps track of separate font sizes for the main display, the main menu text, and the help menu text. When you use the two font sizing commands above, subtracts or adds 1 to each of these three values respectively. On systems like Win32 using TrueType fonts, this works as you would expect, because every font is effectively available in every size. However, in systems like X-Windows or Win32 using fixed-size fonts, you may have to press these keys repeatedly until finds a font matching the requested size.

This can also cause some parts of the display to change but not others. Suppose you are running on X-Windows and have specified that the main display is to use a 12 point font, and that menus and help should use 10 point font. Let's also suppose that the next font available larger than 12 point is 16 point. If you press FONTINCR twice, both the menu text and help text will jump to 12 point, but the main display text will remain unchanged. Why? Because pressing FONTINCR twice tells to set the main display to 14 point (12+1+1) which does not exist, and the menu and help text to 12 point (10+1+1) which does exist, so that change is visible.

The "User-Settable Options" Help Menu displays the font metrics (name, size, weight) you've currently specified. Pressing FONTDECR/FONTINCR changes the size specification and this will be reflected in that menu. However, most systems do some form of "best match" font substitution - if you ask for a font that does not exist, the system will use the "closest matching" font as a substitute. This means the font you see specified in the Help Menu is not necessarily the font you're actually using. You're more likely to run into this when running on a Unix/X-Windows system (where not all the fonts are available in all sizes/weights like they are on Win32 TrueType) as you change the font size with FONTDECR/FONTINCR.

Reloading the (READCONF) will reset the fonts to either their default values or any font sizes specified in the .

Display Command Menu (MOUSECTX)
Right-Mouse-Button

Displays a list of all available commands in a pop-up menu near the mouse pointer. If no commands are defined, this feature does nothing at all. This means commands can be invoked one of three ways: Directly via the Command Key defined in the , via selection in the Command Menu at the top of the GUI, or via selection from the Command Menu.

Win32 users should note that, unlike Windows Explorer, the Command Menu does not change the set of currently selected items. It merely provides a list of available commands. This allows the command chosen via the Command Menu to operate on a previously selected set of items.

Display Directory Menu (MOUSEDIR)
Shift-Right-Mouse-Button

Displays a list of all the directories visited so far in a pop-up menu near the mouse. This means that you can navigate to a previously visited directory in one of two ways: Via a selection in the Directory Menu at the top of the GUI or via a selection from this pop-up menu.

Display History Menu (None - Derived internally)
Control-Shift-Right-Mouse-Button

Displays a list of all commands executed so far (including those entered manually) in a pop-up menu near the mouse pointer. If the Command History is empty, this command does nothing. This means you can repeat a previously entered command via the History Menu or this mouse command. (You can also repeat the last manually entered command by pressing RUNCMD - it will preload its text entry area with the last command you entered by hand.)

Quit Program (QUITPROG)
Control-q

Exit the program.

Re-Read (READCONF)
Control-r

Re-read the . This allows you to edit the while is running and then read your changes in without having to exit the program. This is handy when editing or changing Command Definitions.

Program Options are set back to their default each time a is about to be read (initially or on reload) just before the is parsed. This means commenting out or removing a Program Option Statement (see relevant section below) in the and then pressing READCONF causes that option to be reset to its default value. STARTDIR defaults to either its internal default ($HOME or ./) or to the value given in the Environment Variable/Command line.

Refresh Display (REFRESH)
Control-l

Re-read the current directory's contents and display it. This is most useful if you have turned off automatic directory refreshing with either the -r command line flag or setting the AUTOREFRESH Program Option to False.

Toggle Details (TOGDETAIL)

Control-t

Toggle between detailed and filename-only views of the directory.

Toggle Features (TOGWIN32ALL)
Control-w

As described later in this document, provides enhanced features for Win32 users who also install Mark Hammond's extensions for Python on Win32. This key binding will toggle those advanced features on- and off. This is useful if you happen to be examining a very large directory. The features, while handy, can be computationally expensive and make updates of a directory with many entries somewhat slow. This toggle is provided as a means to temporarily disable the advanced features when viewing such a directory.

Directory Navigation

This family of commands controls movement between directories. If you attempt to navigate into a directory that does not exist or which does not have appropriate permissions, will display a warning message and remain in the current directory. This is unlike the case of a non-existent or unreadable directory specified when the program is first started. In that case, reports the error and aborts.

Change Directory (CHANGEDIR)
Control-x

This is a shortcut that allows you to directly move to a new directory/path - i.e., Without having to navigate to it.

Unless you have set the MAXMENU option to 0, CHANGEDIR keeps track of your last manually entered directory and presents it as a default when you press CHANGEDIR again. You can then move to that directory, edit the string to specify another directory, or delete it and enter an entirely new directory. Directories can be edited with either the arrow and keypad keys defined on your system or by emacs editing commands like Control-a, Control-k, Control-e, and so forth.

Go To Home Directory (DIRHOME)
Control-h

If the "HOME" environment variable is defined on your system, this will move you to that directory. If the "HOME" environment variable is not defined, this command will move to the original starting directory.

Go Back One Directory (DIRBACK and MOUSEBACK)
Control-b
Control-DoubleClick-Left-Mouse-Button

keeps track of every directory visited and the order in which they are visited. This command allows you to move back successively until you get to the directory in which you started. This feature is implemented as a stack - each "backing up" removes the directory name from the visited list. The "Directory" menu (see MENU OPTIONS below) implements a similar feature in a different way and keeps track of all directories visited regardless of order.

Go To Root Directory (DIRROOT)
Control-j

Go to the root directory.

Go To Starting Directory (DIRSTART)
Control-s

Go back to the original directory in which was started.

Go Up To Parent Directory (DIRUP and MOUSEUP)
Control-u
Control-DoubleClick-Right-Mouse-Button

Move to the parent of the current directory ("..").

Display Drive List View (DRIVELIST)
Control-k

This is a Win32-only feature which displays a list of all available disk drives. Details about each drive are also displayed if you have details enabled. In order for this feature to work, you must be running on Win32 AND have the package installed, AND the USEWIN32ALL Program Option must be True (default condition,) AND you must not have toggled these features off with the TOGWIN32ALL key described above. For more details about Drive List View, see the section below entitled, ADVANCED WIN32 FEATURES.

Selection Keys

This family of commands controls the selection of one or more (or no) items in the current directory.

Select All Items (SELALL)
Control-Comma

Select every item in the current directory. The ".." entry at the top of the directory listing is not included. (We almost never want to include the parent directory when issuing a command on "everything in this directory". If you do wish to include the "..", do the SELALL command first, then click on ".." while holding down the Control key.)

Invert Current Selection (SELINV)

Control-i

Unselects everything which was selected and selects everything which was not. As with SELALL, and for the same reason, the ".." entry is never selected on an inversion.

Unselect All Items (SELNONE)
Control-Period

Unselect everything in the current directory.

Select Next Item (SELNEXT)

Control-n

Select next item down in the directory.

Select Previous Item (SELPREV)
Control-p

Select previous item up in the directory.

Select Last Item (SELEND)
Control-e

Select last item in the directory.

Select First Item (SELTOP)
Control-a

Select first item in the directory. This will always be the ".." entry, but it is a quick way to get to the first part of a very long directory listing which does not all fit on-screen.

Select Using Regular-Expression 'Wildcards' (SELWILD)
Control-\

Although provides a very rich set of keyboard and mouse selection commands, selecting a group of files out of list of hundreds or thousands in a large directory can be tedious. If the files/directories you want to select have some lexical commonality in their names OR details you can have select them for you using so-called "Regular Expressions". The idea here is that you press SELWILD and enter a "matching" string or regular expression, and will select all entries which match this criteria for you. For example, if you just enter the text,


tar

would select every file or directory in the current display where the string "tar" appeared anywhere on the line for that file/directory. This is very important: Wildcard matching takes place anywhere on the visible line. So, if you have details turned on, the match can occur anywhere on the permissions, links, group, owner, and so on. Obviously, if you have details turned off, the match can only occur on the name of the file or directory since that's all that is visible.

This is a purposeful design decision because it allows you to make selections on more than just the name. Say you enter the following in the SELWILD dialog:


drwx------

will select all directories with no permissions enabled for group or world users.

The matching string above could also select other entries (not having the permissions just described), if say, this string appeared in their name ... a rather unlikely scenario, but not impossible. If we want to get real specific about which entries we want selected, we need to enter a "regular expression" in the SELWILD dialog. Regular expressions are a far more powerful pattern-matching tool than simple text strings and will allow you to do some fairly amazing selections. For example, this regular expression selects all entries which contain a string beginning with "Ju" followed by any other character, a single space, and ending in "0":


Ju. 0

So, for instance, this would select files with date details (or names, or anything else on the line...) like "Jun 01", "Jul 03", and "Jul 09".

No matter what you specify, a literal matching string or a regular expression, the ".." entry of the currently viewed directory is never selected by SELWILD.

Notice that these regular expressions are not the same thing as the filename "globbing" wildcards commonly used with Unix and Win32 shells. If you enter constructs like "*.txt" or "*.tar.gz", you will not get the results you expect. In fact, these specific examples will cause to grumble and present a warning message.

For an excellent tutorial on Python-compliant regular expressions, see:


    http://www.amk.ca/python/howto/regex/

By default, SELWILD will select an entry when your regular expression matches anything on the displayed line. This allows you to make selections based on any visible column of information. This "match anywhere on the line" semantic is possible because SELWILD automatically massages the regular expression you provide to make "any match on the line" true. There may be times when you want to provide very specific regular expression definitions which seek a match at specific locations. In that case, you can prevent SELWILD from fiddling with your regular expression, by beginning it with the double-quote (") character. SELWILD understands this to mean that your regular expression is to be treated literally without modification. (It only throws away this leading escape character.)

Suppose we changed our example above slightly and used this regular expression:


"^drwx------

Now would select only the directories without any group and world access because:

 The leading double-quote (") forces literal interpretation of the
regular expression - i.e. It turns off "match anywhere" semantics as just described.

The carat (^) at the beginning of the actual regular expression "anchors" the match to the start of the line. For a match to be declared (and for to select an item) the regular expression must be satisfied at the beginning-of-line.

Because regular expressions can get complicated and tedious to type
in, any such expression you use is saved in a history available via the Wildcard Menu (see below).

There is also provision for pre-defining frequently used selection wildcards in your (see below) so you don't have to type them in manually each time you start the program - you can just select them from the Wildcard Menu.

Mouse-Based Selections

The mouse can also be used to select one or more items. A single-click of the left mouse button selects a particular item. Clicking and dragging selects an adjacent group of items. Clicking an item and then clicking a second item while holding down the "Shift" key also selects an adjacent group of items. Finally, a group of non-adjacent items can also be selected. The first item is selected with a single left mouse button click as usual. Each subsequent (non-adjacent) item is then selected by holding down the "Control" key when clicking on the item.

Scrolling Commands

If a given directory's contents cannot be displayed on a single screen, supports both vertical and horizontal scrolling via scrollbars. This capability is doubled on the keyboard with:

Scroll Page Down (PGDN)
Control-v

Scroll down one page in the directory listing.

Scroll Page Up (PGUP)
Control-c

Scroll up one page in the directory listing.

Scroll Page Right (PGRT)
Control-g

Scroll to the right one page width.

Scroll Page Left (PGLFT)
Control-f

Scroll to the left one page width.

Command Execution Options

This family of commands causes to actually attempt to execute some command you've chosen:

Run Arbitrary Command (RUNCMD)
Control-z

This is a shortcut that allows you to run any command you'd like without having to define it ahead of time in the . It is more-or-less like having a miniature command line environment at your disposal.

You may enter a number of different things in the RUNCMD dialog. You may type literal text or refer to any of the variable types (User-Defined, Environment, or Built-In) supported by just as you do in writing Command Definitions (see below). This makes it easy to enter complex commands without having to type everything literally. For example, if you would like to copy all the currently selected files to a new directory, press RUNCMD and enter (on Unix):


cp [SELECTIONS] newdir

understands the variable reference syntax here just as it does in a Command Definition. This also gives you a single way of referring to environment variables, regardless of OS platform. Recall that in Unix-like shells, an environment variable is in the form "$NAME", but on Win32 it is in the form "%NAME%". Instead if having to keep track of this difference, you can just use a Environment Variable reference. For instance, assuming the EDITOR environment variable is set, this command works the same on both systems:


[$EDITOR] [SELECTIONS]

Unless you have set the MAXMENU option to 0, RUNCMD keeps track of your last manually entered command and presents it as a default when you press RUNCMD again. You can then run the command again exactly as you last entered it, you can modify it before running the command again, or you can delete it and enter an entirely new command. Commands can be edited with either the arrow and keypad keys defined on your system or by emacs editing commands like Control-a, Control-k, Control-e, and so forth.

Also see the section below entitled, Program Option Statements, to understand the CMDSHELL option. This option greatly simplifies running command-line programs from RUNCMD so their output can been seen in a GUI window. This is particularly handy on Unix.

Run Selected File / Move To Selected Directory (SELKEY and MOUSESEL)
Return (Enter Key)
DoubleClick-Left-Mouse-Button

If the selected item is a Directory, will move into that directory when this command is issued. If the selected item is a file, will attempt to execute it. Whether or not the file is actually executed depends on how the underlying operating system views that file.

In the case of Unix-like operating systems, the execute permission must be set for the user running (or their group) for the file to be executed.

On Win32, the file will be executed if the user has permission to do so and that file is either executable or there is a Windows association defined for that file type. For example, double-clicking on a file ending with ".txt" will cause the file to be opened with the 'notepad' program (unless the association for ".txt" has been changed).

If determines that it is running on neither a Unix-like or Win32 system, double-clicking on a file does nothing.

Run User-Defined Command
User-Defined (Single Letter)

Key

Each command defined in the has a Command Key associated with it. Pressing that key will cause the associated command to be run. If no command is associated with a given keystroke, nothing will happen when it is pressed.

Directory Shortcuts

provides a way to directly navigate into a frequently-used directory using a single keystroke. You can define up to 12 such "Directory Shortcuts" in the . Each of the definitions is associated with one of the following 12 keys:

Navigate Directly To A Directory (KDIRSC1 ... KDIRSC12)
F1 ... F12

Pressing one of these keys changes to the directory associated with it in the . For more information on this topic, see the discussion of the below entitled, Directory Shortcut Statements.

Program Memories

If you've used GUIs before, you're probably familiar with the idea of a program "Clipboard" - a temporary holding area which is used when cutting, copying, and pasting files. This is a good idea, but has several limitations. First, most systems only have a single clipboard. It would be mighty handy to have muliple Clipboard-like storage areas for keeping track of several different operations at once. Secondly, when you copy or paste something to a conventional Clipboard, its old contents get overwritten. There is no way to keep appending items to the Clipboard. Finally, items usually can only be cut or copied to the Clipboard from the current directory. It would be nice if we could not only keep adding things to the Clipboard, but be able to do so as we navigate around the filesystem.

addresses these concerns by means of 12 separate "Program Memories". As you use , you can add (append) the names of any directories or files in the currently viewed directory by selecting them and then using the appropriate MEMSETx key (see below). To take advantage of this feature, you write Command Definitions (or manually issue a command via the RUNCMD key) which reference the contents of a Program Memory using one of the [MEMx] Built-In Variables. (See the section below on entitled, Program Memory Built-Ins for more details in how to apply Program Memories).

provides key combinations for selectively setting and clearing particular Program Memories as well as a key combination for clearing all Program Memories in a single keystroke:

Clear Selected Program Memory (MEMCLR1 - MEMCLR12)
Control-F1 ... Control-F12

Clear (empty) the selected Program Memory.

Clear All Program Memories (MEMCLRALL)
Control-m

Clear (empty) all 12 Program Memories at once.

Set Selected Program Memory (MEMSET1 - MEMSET12)
Alt-F1 ... Alt-F12

Append the the full path names of the currently selected files and directories to the Program Memory desired.

Sorting Options

provides a variety of ways to sort the display. These can be selected with either a keystroke or from the Sorting Menu (see below). The meaning of the sort depends on whether or not you are in Drive List View (see ADVANCED WIN32 FEATURES below). The table below summarizes the keys associated with sorting and their meaning in the two possible views:


             Program
             Function      Sort Order In    Sort Order In
Key          Name          Normal View      Drive List View
---          --------      ------------     ---------------
Shift-F10  SORTBYNONE      No Sort          No Sort
Shift-F1   SORTBYPERMS     Permissions      Label/Share String
Shift-F2   SORTBYLINKS     Links            Drive Type
Shift-F3   SORTBYOWNER     Owner            Free Space
Shift-F4   SORTBYGROUP     Group            Total Space
Shift-F5   SORTBYLENGTH    Length           Drive Letter
Shift-F6   SORTBYTIME      Time             Ignored
Shift-F7   SORTBYNAME      Name             Ignored
Shift-F11  SORTREV         Reverse Order    Reverse Order
Shift-F12  SORTSEP         Separate Dirs    Ignored

An easy way to remember these is that the function key number for the primary sort keys corresponds to the column position of the key in a detailed display. For instance, Shift-F1 sorts by column 1, Shift-F2 by column 2, and so forth.

These sorting options are available whether or not details are currently available. For example, you can toggle details off, but still sort by one of the now invisible details such as Owner, Length, and so on.

SORTREV reverses the order of the sort.

SORTSEP toggles whether or not directories and files should be grouped separately or displayed in absolute sort order. If enabled, directories will be displayed first, then files. If the sort is reversed via SORTREV, and SORTSEP is enabled, the directories will appear after the files, sorted by whatever sort key has been chosen. SORTSEP is not meaningful in Drive List View and is ignored.

You'll find the currently selected sorting options displayed in the program titlebar.

Menu Options

Although is primarily keyboard-oriented, several menu-based features are also implemented to make the program more convenient to use. These menus appear at the top of the display window, above the directory listing.

Invoking A Menu

A menu can be invoked in one of several ways. You can click on it, you can press its associated "Accelerator Key" combination, or you can use the "Mouse Shortcut" to cause a copy of the menu to pop-up near the mouse pointer. The Accelerator Keys are shown in parenthesis next to the menu names below and the Mouse Shortcuts are similarly shown below in square brackets. All menus have Accelerator Keys defined, but only some menus have associated Mouse Shortcuts.

Detaching A Menu

The first item in each menu is a dashed line ("----") which indicates that it is a "tearoff" menu. Clicking on the dashed line will detach the menu from allowing it to be placed anywhere on screen. Even when detatched, these menus remain current and in-sync with as it continues to run. You can also tear off multiple instances of these menus if you'd like copies of them at several locations on the screen simultaneously.

Managing The Size Of Dynamic Menus

A number of these menus have "dynamic" content - their content changes as the program runs. For example, the Directory, History, and Wildcard menus all keep some sort of "history" of what the program has done. Their content thus grows longer as the program is used.

On Win32 systems, if such menus grow too long to physically fit on screen, up- and down- scrolling arrows automatically appear at the top- and bottom of the menu respectively. This is not a feature of the Unix Tk implementation, so menus which grow too large are simply truncated to fit the screen on Unix-like systems.

There are two User-Settable Options options available to help you manage the maximum size of dynamic menus (see the section below on the which explains how such options are actually set. The MAXMENU option specifies the maximum number entries that will be displayed in any dynamic menu. ( internally tracks MAXMENUBUF number of items for each dynamic menu.) This defaults to 32 as is intended to keep the menu size reasonable.

If you set MAXMENU=0, it means you are disabling all dynamic menus. It also means that no interactive dialog will "remember" your last manual entry. For example, with MAXMENU set to 0, will not keep track of your last manual entries for the CHANGEDIR, SELWILD, and RUNCMD dialogs.

MAXMENUBUF specifies the size of the internal storage buffer for each dynamic menu regardless of how many entries are actually displayed. i.e. MAXMENUBUF determines how many dynamic events each menu tracks internally regardless of how many are actually visible in the menu at any moment in time. It defaults to 250 and probably never needs to be changed. If you set MAXMENUBUF to be less than MAXMENU, then this smaller value will determine the maximum size of the displayed menu. Setting MAXMENUBUF to 0 is equivalent to setting MAXMENU to 0.

Commands Menu (Alt-c) [Right-Mouse-Button]

Every command defined in the is listed in this menu by its Command Name. The association Command Key is also shown in parenthesis. Clicking on an item in this menu is the same as invoking it from the keyboard by its Command Key. This is a convenient way to invoke an infrequently used command whose Command Key you've forgotten. It is also handy to confirm which commands are defined after you've edited and reloaded the . The commands are listed in the order in which they are defined in the configuration file. This allows most frequently used commands to appear at the top of the menu by defining them first in the . If no commands are defined, either because the contains no Command Definitions or because the cannot be opened for some reason, the Commands Menu will be disabled (grayed out).

Directories Menu (Alt-d) [Shift-Right-Mouse-Button]

keeps track of every directory visited. The previously described command to move "Back" one directory allows directory navigation in reverse traversal order - you can back up to where you started. However, this feature "throws away" directories as it backs up, sort of like an "undo" function.

The "Directories" menu provides a slightly different approach to the same task. It keeps permanent track of every directory visited and displays that list in sorted order. This provides another way to move directly to a previously visited directory without having to manually navigate to it again, back up to it, or name it explictly using the Change Directory command.

Unless MAXMENU is set to 0, the Directory Menu shows the last MAXMENU directories visited in alphabetically sorted order (unless you change MAXMENUBUF to be smaller than MAXMENU). "Visited", in this case, is stretching things a bit. All Directory Shortcut locations are also preloaded into the Directory Menu when the program starts even though they have not yet actually been visited.

The Directory Menu is emptied and grayed out when you press the CLRHIST key. (default: Control-y)

History Menu (Alt-h) [Shift-Control-Right-Mouse-Button]

keeps track of every command you attempt to execute, whether it is an invocation of a Command Definition found in the or a manually entered command via the RUNCMD key. (default: Control-z) This is done whether or not the command is successfully executed.

This feature provides a quick way to re-execute a command you've previously run. When you select a command to run this way, a dialog box is opened, giving you an opportunity to edit the command before running it again.

One important point of clarification is in order here. If you run one of the commands defined in your , it is stored in the History after all variable substitutions have been made. But, manually entered commands are stored in the History literally as typed - i.e., Without variable substitution. This allows you easily reuse a manually entered command in another directory or context. (Presumably, Command Definitions in the are written in such a way so as to be useful across many different directories and contexts. Running such a command again is simply a matter of pressing its associated letter key once more. By storing the resolved version of the command in the History, you can see what the command actually did.)

The History Menu is emptied and grayed out when you press the CLRHIST key. (default: Control-y)

Sorting Menu (Alt-s) [No Mouse Shortcut]

This menu provides a way to select any of the available sorting options. It is context-sensitive and will show entries appropriate to what kind of "view" the program is currently displaying. That is, it will show options which make sense for both "normal" view as well as "Drive List View" (see the ADVANCED WIN32 FEATURES section below).

You'll find the currently selected sorting options displayed in the program titlebar.

Wildcard Menu (Alt-w) [Alt-Control-Right-Mouse-Button]

 

(Note that on Win32 you must press Alt then Control then Right-Mouse-Button for this to work. Win32 appears to care deeply about keystroke order.)

This menu provides a list of all previously used selection "wildcard" regular expressions. Any regular expressions defined in the (see below) using the "WILDCARD = " statement will also appear in this menu. This saves you the tedium of constantly having to enter complex regular expression syntax every time you wish to do wildcard-based selections.

Selecting something from this menu brings up a dialog box which allows you to edit the selected wildcard before using it.

Bear in mind that the size of the displayed menu is governed by the MAXMENU and MAXMENUBUF options (see below). i.e., Only the last MAXMENU number of wildcards are actually displayed on the menu.

The Wildcard Menu is emptied and grayed out when you press the CLRHIST key. (default: Control-y) This history is not cleared if the is reloaded.

Help Menu (Alt-l) [No Mouse Shortcut]

This menu provides information about various internal settings of including User-Defined Variables, Command Definitions, Internal Program Variables, User-Settable Options, Keyboard Assignments, and Directory Shortcuts. It also has an About feature which provides version and copyright information about the program.

For the most part, this help information should fit on screen easily. However, very long Command Definitions will probably not fit on-screen once User-Defined and Environment Variables have been substituted. In this case, if you are curious about just how is interpreting your Command Definitions, invoke the program with the relevant debug bit turned on and watch the output on stdout as runs.

the tw Configuration File

Much of s flexibility comes from the fact that it is a macro-programmable user interface. The program itself does little more than provide a way to navigate around a filesystem. It must be configured (programmed) to actually do something with the files you specify. This is done via a "". This file is also used to set Program Options and change keyboard assignments. Although the program will run without a present, it will warn you that it is doing so with no commands defined.

Location of Configuration File

By default, the program expects to find configuration information in $HOME/.twander (%HOME%\\.twander on Win32) but you can override this with the -c command line option. (Recommended for Win32 systems - see the section below entitled, INSTALLING )

Actually, can look in a number of places to find its . It does this using the following scheme (in priority order):

Configuration File Format

s consist of freeform lines of text. Each line is considered independently - no configuration line may cross into the next line. Whitespace is ignored within a line as are blank lines.

There are several possible legal lines in a Configuration File:


Comments
Program Option Statements
Key Binding Statements
Directory Shortcut Statements
Wildcard Statements
Variables And Command Definitions
Conditional Processing Statements
The Include Directive

(See the ".twander" file provided with the program distribution for examples of valid configuration statements.)

Everything else is considered invalid. will respond with errors or warnings as is appropriate anytime it encounters a problem in a . An error will cause the program to terminate, but the program continues to run after a warning. For the most part, tries to be forgiving and merely ignores invalid configuration statements (after an appropriate warning). It only declares an error when it cannot continue. This is true both when the program initially loads as well as during any subsequent reloads initiated from the keyboard while running .

The following sections describe each of the valid Configuration File entires in more detail.

Comments

A comment is begun with the "#" character which may be placed anywhere on a line. Comments may appear freely within a . strictly ignores everything from the "#" to the end of the line on which it appears without exception. This means that "#" cannot occur anywhere within a User-Defined Variable Definition, Key Binding Statement, or Command Definition (these are described below). Comments can be placed on the same line to the right of such statements.

It is conceivable that the "#" character might be needed in the Command String portion of a Command Definition. provides a Built-In Variable, [HASH], for exactly this purpose. See the section below entitled, Variables And Command Definitions, for a more complete description.

Program Option Statements

Many of s internal program defaults can be overriden in the using Program Option statements. These statements look just like the User-Defined variables described later in this document except recognizes the variable name as a Program Option rather than an arbitrary variable. Program Option Statements thus take the form:


Option Name = Option Value

The Option Name is case-sensitive and must be entered exactly as described below. For instance, understands "AUTOREFRESH" as a Program Option, but will treat "AutoRefresh" as a User-Defined Variable.

The Option Value is checked to make sure it conforms to the proper type for this variable. The Type can be Boolean, Numeric, or String.

A Boolean Option must be assigned a value of True or False. These logical values can be in any case, so TRUE, TRue, and tRue all work. Note that when you view these variables in the Help menu entitled, User-Settable Options, they are displayed as 0 (False) and 1 (True).

A Numeric Option must be a number 0 or greater. Numbers can also be entered in hexadecimal format: 0xNNN, where NNN is the numeric expression in hex.

A String Option can be any string of characters. Quotation marks are treated as part of the string! Do not include any quotation marks unless you really want them to be assigned to the option in question (almost never the case).

Furthermore, as described above, you cannot use the '#' symbol as part of the string assignment because always treats this character as the beginning of a comment no matter where it appears.

For consistency with other entries, Program Option Statements may have a blank Right Hand Side. Such statements are simply ignored. This is convenient when you want to leave a placeholder in your but don't actually want to activate it at the moment. However, be careful - depending on what precedes the statement, you'll get different settings for the option in question. For example:


# This effectively sets BCOLOR to its default value when
# the  is reloaded
BCOLOR =
# But this means the value of BCOLOR is set to red
BCOLOR = red
BCOLOR = 

In other words, you should think of Program Option Statements
with a blank Right Hand Side as comments - present but ignored.
Other than this basic type-checking,  does no further
validation of the Right Hand Side of a Program Option Statement.
It is perfectly possible to provide a RHS which passes s
type validation but which makes no sense whatsoever to the program.
Entries like this cause everything from a mild  warning
to a spectacular program failure and Python traceback on stdout:

# A Nice Way To Clobber 
BCOLOR = goo

The following sections document each available Program Option using this general format:


Option-Name [Type] (Default Value)

AUTOREFRESH [Boolean] (True)

By default, regularly re-reads the current directory to refresh the display with any changes. If you are running on a very slow machine or slow connection between the X-Windows server and client, set this option to False. You can manually force an update at any time using the REFRESH key. (default: Control-l)

BCOLOR [String] (Black)

Selects the main display Background Color.

CMDSHELL [String] ()

This option is primarily intended for people running on Unix-like operating systems like FreeBSD and Linux. As described in the GOTCHAS section below, running a command line program or script requires some extra effort if you want to see the results presented in a GUI window. Typically, you need to run these commands in some kind of 'xterm' context so that the results will be visible, possibly using a shell as well. So, it's common to see Command Definitions like:


x MyCommand   xterm -l -e bash -c 'stuff-for-my-command'

In fact, on Unix, the need for this idiom is so common, it's best to define some variables for this. If you look in the example '.twander' provided in the program distribution, you'll see something like (comments removed):


SHELL       = bash -c
VSHELL      = [XTERM] [SHELL]
XTERM       = xterm -fn 9x15 -l -e

Now the Command Definition above becomes:


x MyCommand [VSHELL] 'stuff-for-my-command'

That's all well and good for Command Definitions, but what happens when you want to manually enter a command via the RUNCMD key? (default: Control-z) You have to manually enter the gobbledy-gook above, or at least start your command with [VSHELL] (since RUNCMD understands variable references).

The CMDSHELL option is a way to automate this. You can assign it to any literal text. That text will be automatically prepended to any command you enter manually. In this case you could do either of the following in the :


CMDSHELL = xterm -l -e bash -c
            - or -
CMDSHELL = [VSHELL]  # Assuming VSHELL is defined previously

Now every time you enter a command, this will be placed in front of your text before command execution commences.

To disable CMDSHELL operation permanently, just remove the statement above from your . If you want to leave it in as a placeholder, but deactivate CMDSHELL, use the following statement:


CMDSHELL = 

You also may want to occasionally use RUNCMD to do something without CMDSHELL processing, even though that feature has been defined in the . You can disable CMDSHELL operation on a per-RUNCMD basis. Just begin your entering your command with the double-quote (") character. understands this to "escape" CMDSHELL processing.

As a general matter, CMDSHELL allows you to prepend anything you like before a manually entered command - literal text, references to variables, or even the name of a script the system will use to execute your command. Whatever value you use for CMDSHELL will appear in the Command Menu history for each manually initiated command which used this feature - i.e., All the manual commands that did not escape the feature.

DEBUGLEVEL [Numeric] (0)

This is another way to set the debugging level you desire (the other way being the -d command line argument). For example, say you want to always dump the current Command Definitions to stdout when the program starts - perhaps you want to redirect this output to a file or printer. Just add this line to your :


DEBUGLEVEL = 0x004

FCOLOR [String] (green)

Selects the main display Foreground (Text) Color.

FNAME [String] (Courier)

Selects the main display Font Name.

FSZ [Numeric] (12)

Selects the main display Font Size.

FWT [String] (bold)

Selects the main display Font Weight. This can be assigned to: normal, bold, italic, or underlined. Depending on your system, other values may also be possible.

HBCOLOR [String] (lightgreen)

Selects the help menu Background Color.

HEIGHT [Numeric] (600)

Initial vertical size of the window in pixels.

HFCOLOR [String] (black)

Selects the help menu Foreground (Text) Color.

HFNAME [String] (Courier)

Selects the help menu Font Name.

HFSZ [Numeric] (10)

Selects the help menu Font Size.

HFWT [String] (italic)

This selects the help menu Font Weight.

MAXMENU [Numeric] (32)

Maximum number of entries to display in any dynamic menu. This keeps the menu size reasonable. Internally, keeps track of way more than this number of dynamic entiries (see the MAXMENUBUF option below).

MAXMENUBUF [Numeric] (250)
Maximum number of items tracks internally for each dynamic menu. This value need normally not be changed. It is present only to bound how much memory consumes for this task.

MAXNESTING [Numeric] (32)

Number of times a Command Definition is processed to dereference all variables. For example, suppose you have this:


FOO = bax
BAM = x[FOO]
x mycmd [BAM] [SELECTION]

When you press the x key, the command interpreter has to process the line repeatedly until all variables are resolved:


[BAM] [SELECTION]   -> x[FOO] [SELECTION]
x[FOO] [SELECTION]  -> xbax [SELECTION]
xbax [SELECTION]    -> xbax selected-item

So, in this case, it took 3 iterations to do this. MAXNESTING merely sets the maximum number of times this is permitted. We have to do this to stop runaway definitions like this:


FOO = x[FOO]

This kind of construct will cause to iterate MAXNESTING number of times and then give up with a warning about exeeding the nesting (dereferencing) limit.

A 32 iteration limit should be plenty for any reasonable Command Definitions. If you set MAXNESTING to 0, will not allow any variable dereferencing, including the Built-In Variables. This is probably not what you want.

MBARCOL [String] (beige)

Selects the Menu Bar color.

MBCOLOR [String] (beige)

Selects the menu Background Color.

MFCOLOR [String] (black)

Selects the menu Foreground (text) Color.

MFNAME [String] (Courier)

Selects the menu Font Name.

MFSZ [Numeric] (12)

Selects the menu Font Size.

MFWT [String] (bold)

Selects the menu Font Weight.

NODETAILS [Boolean] (False)

Prevents details from ever being displayed.

NONAVIGATE [Boolean] (False)

Prevents the user from navigating out of the starting directory. Command Definitions and commands initiated manually via RUNCMD (default: Control-z) can still "see" other directories, the user just cannot move elsewhere with any of the navigation commands.

The NODETAILS and NONAVIGATE commands are not security features. They can easily be defeated by editing the . They exist to make it easy for you to create 'twander' configurations for technically unsophisticated users.

Say you want to define a few simple commands for your boss to use which won't challenge his or her feeble managerial mind ;) By defining these commands and setting both NODETAILS and NONAVIGATE to TRUE, you really limit what can be done with . They can't wander off into other directories and get lost, or worse yet, clobber files they don't understand. There are no details to confuse them. Your instructions for using the program thus become, "Select the files you're interested in and press P to print them, M to mail them to Headquarters.." and so on.

Again, these are NOT security features. Anyone with even very modest technical skills can thwart these limitations. But, it is suprising just how effective these can be in simplifying life for technically challenged users.

QUOTECHAR [String] (")

As described below, ordinarily quotes most Built-In Variables as it replaces them during command processing. This is useful because modern operating systems allow file and directory names to have spaces in them. Such names must be quoted for most programs to understand them as a single entity on a command line.

By default, the double-quote char is used for this purpose. You can suppress quote processing by using the -t command line argument. This does nothing more than set QUOTECHAR to an empty string. Unfortunately, since the RHS of a Program Option Statement cannot be blank, you cannot disable quoting with this option. However, you can set the quotation character to be anything else you like, such as a single-quote. In fact, you can set QUOTECHAR to any string of characters you like and they will faithfully be used on either side of a Built-In Variable replacement.

REFRESHINT [Numeric] (5000)

Nominal time in milliseconds between automatic directory refreshes (if AUTOREFRESH is True). This time is really nominal and should not be used with any accurate timing in mind. REFRESHINT=8000 says that the refresh interval will be nominally 8 seconds (and certainly more than the default of 5 seconds), but it can be off this nominal value by quite a bit.

If you run on a slow system (or have a slow link between X-Client and X-Server) you might want to increase this value substantially. You can get into the situtation where just as one refresh completes, its time to do the next one, and the will seem really sluggish and unresponsive. By lengthening the time between automatic updates, the amount of unresponsive behavior is reduced. Of course, this also means that any changes in the currently viewed directory will also take longer to appear in the display.

SORTBYFIELD [String] (Name)

Specifies which field is to be used as the sort key. May be one of the fields below under "Sort Key" (case-insensitive). The equivalent field name for Drive List View (see ADVANCED WIN32 FEATURES section below) is shown in the second column, however these may not be used as arguments for SORTBYFIELD. For example, if you plan to start the program in Drive List View and want to sort by Drive Type, use: SORTBYFIELD=Links.


                        Equivalent
  Sort Key         Drive List View Field
  --------         ---------------------
  No Sort          No Sort
  Permissions      Label/Share String
  Links            Drive Type
  Owner            Free Space
  Group            Total Space
  Length           Drive Letter
  Time             Drive Letter
  Name             Drive Letter

SORTREVERSE [Boolean] (False)

Specifies whether to reverse the sort order or not. If True and SORTSEPARATE is also True, then the directory list will appear at the end of the display in addition to being reverse ordered.

SORTSEPARATE [Boolean] (True)

Determines whether directories and files should be separated or mingled in absolute sort order in the display. By default, they are separated with directories sorted according to SORTBYFIELD order but appearing before any files in the display.

This option is ignored in Drive List View.

STARTDIR [String] (Directory In Which Program Started)

This allows you to force a starting directory of your choice no matter where the program actually is launched. This is useful for day-to-day operation - perhaps you always want to start in your home directory. STARTDIR is also handy in tandem with the NODETAILS and NONAVIGATE options to force a user to the only directory which they should be using.

STARTX [Numeric] (0)

Initial horizontal offset of the window in pixels.

STARTY [Numeric] (0)

Initial vertical offset of the window in pixels.

USETHREADS [Boolean] (False)

defaults to using normal "heavy weight" processes for running commands on Unix. Many Unix implementations also support a "threaded" process model. Setting USETHREADS to True on such systems will cause to use threads, rather than processes to launch user-defined commands. There are some known issues with thread-based operations (hence the reason this option defaults to False). These are discussed in the GOTCHAS section below.

This option applies only to Unix-like operating systems. Win32 commands are always run as a thread - this is the only process model Win32 supports..

USEWIN32ALL [Boolean] (True)

Win32 only. If is installed, determines whether its features should be used (see section below entitled, ADVANCED WIN32 FEATURES for details).

Normally, this option should be left alone. However, if you have installed on your system for some other reason, but don't want it used by , set this option to False.

The main reason to do this would be on a slow machine with very large directories. The advanced features of come at a computational price. This is especially noticeable when it is computing the attributes, ownership, and size in a directory with hundreds (or more) of entries. Typically, you would just use the TOGWIN32ALL key (default: Control-w) to temporarily disable these features before entering such a directory. However, if your starting directory is in this category, setting USEWIN32ALL=False might not be a bad idea.

WARN [Boolean] (True)

Determines whether interactive warnings should be displayed as encounters them (while parsing a Configuration File or just in normal execution).

Setting this option to False is the same thing as using the -q command line option with one important difference: The is parsed before the command line is parsed. Even if you have -q on the command line (or in the TWANDER environment variable), if there is an error in your , you will see warning messages at program startup time. Putting WARN=False at the top of your will suppress this.

It is not recommended that you operate normally with the -q flag or with WARN=False. is pretty forgiving in most cases and when it does warn you about something, there is a good reason for it - you probably want to know what the problem is.

WIDTH [Numeric] (800)

Initial horizontal size of the window in pixels.

A few general notes about Program Options are worth mentioning here:

Key Binding Statements

No program that runs in many operating environments can satisfy everyone's (anyone's!) idea of what the "correct" key bindings should be. An emacs user, vi user, BSD user, and Windows user are going to differ considerably on what keys should be bound to what feature. ships from the factory with a set of default key bindings, but it also provides a mechanism for changing these bindings via entries in the .

This feature is available only for Keyboard Assignments. Mouse Button Assignments may not be changed by the user. An attempt to do so in the will cause to display a warning and ignore the offending line.

It is not difficult to override the default keyboard bindings by adding entries in the . Doing so requires some familiarity with how Tkinter names keystrokes. Good resources for learning this exist abundantly on the Internet, among them:


http://www.pythonware.com/library/tkinter/introduction/index.htm
http://www.nmt.edu/tcc/help/pubs/lang.html
http://www.cs.mcgill.ca/~hv/classes/MS/TkinterPres/

(As an aside - Tkinter is nothing more than a Python interface to the Tcl/Tk windowing system. The "real" naming conventions for keystokes can be found in the many sources of Tk documentation, both in print and on the Internet.)

Keyboard binding assignments look just like variable definitions in the . (The parser automatically distinguishes between Key Binding Statements and Variable Definitions or other legitimate statements. This means you can never use one of the program function names as one of your own variable names.) Key Binding Statements thus take the form:


Program Function Name = Tkinter Keystroke Name

Changing the default bindings is therefore nothing more than a matter of assigning the appropriate Program Function Name (found in parenthesis next to the description in the default descriptions above) to the desired keystroke.

Examples of all the default key bindings are shown as comments in the ".twander" example supplied in the program distribution. The easiest way to rebind a particular function is to copy the relevant line, uncomment the copy, and change the right side of the assignment to the new key you'd like to use.

It is important to observe several rules when rebinding keys:

Directory Shortcut Statements

provides a mechanism for directly navigating into one of 12 frequently used directories. 12 keys, KDIRSC1 ... KDIRSC12 (default: F1 ... F12) have been set aside for this purpose. Directory Shortcut Statements are entries in the which associate one of these keys with a particular directory path. These statements are in the form:


DIRSCxx = path
   where, xx is a number from 1-12

So, for example, if you want to enter "C:\Documents And Settings" when you press the F5 key, you would add this to your Configuration File:


DIRSC5 = c:\Documents And Settings

There are several subtleties to Directory Shortcuts you should understand:

Wildcard Statements

As discussed above, provides powerful regular expression-based "wildcard" selection capabilities via the SELWILD command. (default: Control-\) These regular expressions can be complex and tedious to enter by hand each time you need them. You can pre-define frequently needed wildcard strings in your Configuration File using the following statement:


WILDCARD = regular-expression-string

This regular expression will then be pre-loaded into the Wildcard Menu (making it easy to invoke by just clicking on it) when starts. You may place as many of these as you like in your . (Though the menu will be limited to displaying MAXMENU number of items - see the section above on Program Option Statements.)

Variables And Command Definitions

Most programs "ship from the factory" with a pre-defined set of features or commands. comes with no built-in commands! Instead, it comes with a mechanism which allows you to specify your own Command Definitions. By means of a simple and very powerful macro lanuage, you "program" and equip it with commands of your own choosing. For example, you might define commands to copy, delete, edit, and move the files or directories you choose. Perhaps you have a specialized shell script for doing backups. It's a simple matter to write a Command Definition that will pass the names of the files and directories you've selected to that backup script. You might combine this with s Program Memory feature to keep a running list of the files and directories you want to backup and then finally issue the backup command when you're ready. Best of all, commands you define this way are always a single keystroke. This means that once you've programmed to suit your needs, actually using it is very fast and convenient.

Command Definitions are built out of literal text and may also have any combination of three variable types: User-Defined Variables, Environment Variables, and Built-In Variables.

User-Defined Variables And Environment Variables

User-Defined Variables are defined using the syntax:


Variable Name = Replacement String

Environment Variables are referenced using the syntax:


[$VARIABLE]

Say we have a configuration line like this,


EDITOR = emacs blah blah blah blah

Later on, when defining a command, instead of typing in "emacs blah blah blah blah", you can just refer to the variable [EDITOR] - the brackets indicate you are referring to a previously defined variable.

Similarly, suppose you have an environment variable called "EDITOR" which indicates your preferred editing program. Our definition could thus become:


EDITOR = [$EDITOR] blah blah blah blah

Why bother with this? Because it makes maintaining complex s easier. If you look in the example ".twander" provided in the program distribution, you will see this is mighty handy when setting up complex "xterm" sessions, for example.

Here are several other subtleties regarding User-Defined Variables: