Trowser is a browser for large line-oriented text files, implemented in Tcl/Tk. It's meant as an alternative to "less". Compared to less, trowser adds color highlighting, a persistent search history, graphical bookmarking, separate search result (i.e. filter) windows and flexible skipping of input from pipes to STDIN. Trowser has a graphical interface, but is designed to allow browsing via the keyboard at least to the same extent as less. Key bindings and the cursor positioning concept are derived from vim.
Note: in this context "line-oriented" denotes that each line of text is considered a data unit. Color highlighting (including search matches) will always apply the highlight to the complete text line.
The screenshots to the right show some of the main features:
- The first screenshot shows the main window with a text which has color highlighting applied and an ongoing incremental search (for an expression which matches the line marked in yellow) plus three bookmarked text lines;
- The second screenshot shows the highlight pattern editor dialog (holding the patterns used for the previous screenshot);
- The third screenshot shows the search history dialog (i.e. a list of previously used search patterns) and the search result list (the list is filled with all lines matching the three patterns selected in the search history list shown above; one line is highlighted in yellow as it matches a new search in the main window);
- The fourth window shows the bookmark list (these are the lines marked with a blue dot in the first screenshot);
- The last screenshot shows the pipe load dialog which pops up when the input stream exceeds the buffer size to allow skipping excessive input data.
For details and options please refer to the manual page.
trowser was developed for sifting through debug output files written by software under development. Such debug files can get very large; in the extreme, there could be a line of trace written for every entered function (e.g. documenting the call and actual parameters) and one more line every time a function is left. When debugging complex exceptions, it's often necessary to analyze several hundreds or thousands of lines of debug trace to understand the cause.
Such analysis usually start by first looking at top-level events (e.g. stimuli by the environment) and then digging down into the details. trowser was developed to facilitate this process. Of course one could also use standard tools such as "grep" or "awk" and "less" or "vim" to tackle this task, but this way lots of repetitive manual hacking on the command line is required. For an every-day task, it seems worth to invest some time into automating the process in a specialized tool.
As of release 1.3, some of trowser's features are still not that much different from what can be found in various regular text editors. Future development may further extend the filtering capabilities (e.g. by allowing multiple search results windows and pre-defined stacks of search patterns to allow quick folding-in and -out of trace detail levels.) Additionally, trowser already has the capability to automatically parse data out of the trace file which can be included in bookmarks and search results list and could easily be extended in that direction for different applications. With less than 9000 lines of code trowser still is a relatively small application (in large part thanks to the powerful "text" widget in Tk) so there's only a low barrier of getting familiar with the source code to allow extending or adapting the functionality for your own needs.
Release 1.3 contains a number of improvements and bug fixes:
- Background highlighting tasks have been improved in respect to scrolling or jumping, so that no incompletely highlighted text portions become visible anymore.
- Background search and highlighting tasks have been made "smoother" so that interactive use is less hindered.
- A bug in background task management has been fixed which sometimes led to an infinite lock-up of background tasks.
- The display of progress bars and status messages has been changed to work better with some older window managers (which previously painted those windows with decorations and failed to force them to the top.)
- A work-around for a Tk text(3) anomaly which caused very slow processing of the "Discard text below/above cursor" command was added.
- The performance and usability of several search list commands was improved by changing them into background tasks with progress bar and allowing to abort ongoing tasks via the "Escape" key.
- A confirmation dialog was added before aborting an ongoing search, offering to delay the new command until the current operation is completed.
- The performance of the "frame number" calculation in the search list was improved by extending the cache.
- Search "all" was improved to keep the currently selected text line visible (i.e. instead of scrolling away upon insertions.)
Release 1.3. also contains the following new features:
- Key bindings (ALT-N and ALT-P) and command buttons were added to allow restricting "search all" to matches below or above the current cursor position.
- Key bindings "u" and CTRL-r were added to the main window, to allow quick undo or redo of additions to the search list.
- The search history was extended to remember the case match and regular expression options.
- A new command was added to the search list dialog which allows importing line number lists (such as generated by grep -n)
- Vim compatibility of key bindings in the main window was improved by adding jump stack control commands CTRL-o and CTRL-i and extending the list of commands which allow repeat counts.
Release 1.2 extends and improves on existing features, especially around the search filter list:
- The possibility to bookmark text lines in the search result window was added.
- The possibility to "undo" additions and removals in the search result window was added.
- Searching among entries in the search result list via "n" and "N" was added.
- Various performance improvements in dealing with large number of lines were implemented.
- Background task scheduling (for search and highlighting) was improved to interfere less with interactive tasks.
- The synchronization of viewable portions in main and search list windows was improved.
- Key bindings "n" and "N" were improved to match vim behavior (e.g. on an empty search entry field.) Also, focus traversal between the main text and the search entry field was improved.
- Key bindings "+" and "-" were corrected to change font size of highlighted text, too.
- The possibility to wrap long text lines in the main window via key binding "ALT-W" was implemented.
Latest version is 1.3, released March 31 2009:
- trowser-1.3.tar.gz (Sources, apx. 80 kB)
- trowser_1.3_all.deb (Debian package, platform independent)
- trowser-1.3-2.noarch.rpm (RPM package, platform independent)
Predecessor version 1.2, released March 14 2009:
- trowser-1.2.tar.gz (Sources, 76 kB)
- trowser_1.2_all.deb (Debian package, platform independent)
- trowser-1.2-2.noarch.rpm (RPM package, platform independent)
For Debian, Ubuntu and compatibles download the .deb package. For SuSE et.al. use the .rpm package. For manual installation, use the source tar ball.
Supported platforms: trowser can be used on all platforms which are supported by Tcl/Tk, i.e. all UNIX variants, Linux, Mac, even MS Windows if you have to.
Software requirements: trowser is written in Tcl/Tk which is an interpreted language. So you need to have the Tcl/Tk interpreter: tcl.tk (version 8.4 or later)
Hardware requirements: trowser loads the complete text into memory (i.e. in a Tk text widget) and also applies highlighting to the complete text to allow fast navigation. Hence when browsing large files, trowser benefits from using a fast machine and at least 5 times your text size in RAM.
The software is released under the GNU General Public License, version 3.