1Version 0.94 2/15/99 2Ethan Gold <etgold@cs.columbia.edu> 3http://www.cs.columbia.edu/~etgold/software/tkRunIt/ 4Freshmeat.net appindex record: 911881415 5 6TkRunIt is a simple text entry widget which allows you to 7run command lines without resorting to a full shell. Of course 8it's written in Tcl/Tk so it probably has as much overhead as 9starting an xterm with a shell, but it's cute anyway. 10TkRunIt has several cousins, but implements a slightly different 11interaction philosophy as well being as a good little exam 12procrastination timesink. 13 14Please read the INSTALL document that accompanies this distribution. 15 16Features: 17--------- 18(see Options section below for a detailed list) 19 20* interactive filename completion (tab), including filenames with 21 embedded spaces 22* interactive environment variable name completion (tab) 23* Full command history with simple !, !!, !!!, and prev/next syntax 24* Complete(?) keyboard bindings for running, completing, history 25 and quit 26* Command-line parameters are inserted into the entry widget 27 so runit can be used as a trivial generalized file handler for 28 something like Netscape or whatever. 29* all options, colors, and directives settable from config file 30* -wait and -persistent options for synchronous and 31 continuous operation (in addition to standard "&" syntax) 32* All output sent to an optional message box 33* Verbose output can be set in the config file or toggled interactively 34* Completely navigable from the keyboard 35* chdir (cd) implemented internally as in a normal shell 36* "autokill" option which captures backgrounded job PID's to pass 37 to the kill command 38 39 40Options: 41-------- 42The runitrc.sample file enumerates all of the settable options which 43are described below. Some of the options are also supported on the 44commandline. The rcfile (~/.runitrc) must be valid tcl code. 45Note that all widths and heights are in units of characters and lines 46respectively. 47 48maxhist: the number of history items to save (enforced at startup time) 49wtitle: the window title 50bgcolor: background color for the entry widget 51fgcolor: foreground (text) color for the entry widget 52hicolor: border highlight color for the entry widget 53vbhicolor: border highlight color for the entry widget in verbose mode 54borderwidth: border width of the entry widget 55listfont: font to use for the contents of the listbox 56defaultfont: font to use unless otherwise specified 57 defaults to "Helvetica -12" 58labelfont: font to use for the messages and output 59mesgfont: font for the text window messages 60maxwidth: maximum width for the message output 61maxheight: maximum height for message output and listbox 62defaultcmd: a default command string to show in the entry widget on startup 63verbose: boolean which toggles the message widget for output, errors, 64 and run status (for persistant) in addition to the file completion 65 listbox 66showlabel: display a little label in verbose mode 67location: geometry-style location description i.e. "+10-500" 68 -l, --location commandline switches override this value 69wait: boolean indicating that runit should wait for the executed 70 command to complete before quitting oraccepting more input 71 "--wait" or "-w" commandline switch forces wait to be true. 72persistent: boolean indicating whether or not to exit after each command 73 is executed. The "--persistent" and "-p" commandline options 74 force persistant to be true. (+w, +p turn off wait and persistent 75 respectively) 76mouseloc: boolean indicating that the window should appear under 77 the current mouse location. --mouseloc and -m on the commandline 78 turn this on, ++mouseloc and +m turn it off 79autokill: boolean indicating that backgrounded jobs should have their 80 PID placed back into the commandline in the form "kill $PID" 81 82Bindings: 83--------- 84tkRunIt is designed to be entirely navigable from the keyboard. 85I've crafted the keybindings to fit the way I work and 86expect things to work. Since I haven't figured out a good 87way of putting bindings into a config file, they can only 88be changed by editing the program source directly. However, 89I think they are reasonably consistant with expected behaviors. 90The conditions governing the appearance and disappearence of the 91file list box are pretty hardcoded and not very configurable except 92by turning off the verbose flag entirely. 93 94 entry widget: 95 ------------- 96 Return: execute the current command 97 Tab: complete the filename (assumed to be the last item) 98 may generate a listbox if "verbose" is true 99 Shift-Tab: focus on the main output area, command output or 100 completions 101 Up, Control-p: previous item in history 102 Down, Control-n: next item in history 103 Control-v: toggle verbose on and off 104 Control-c: clear commandline 105 Escape, Control-w,q: quit 106 !.*: run the last command matching the initial expression 107 following the ! 108 ![0-9]+: run the command number matching the number following 109 the ! 110 !!: run the previous command 111 !!!: display the numbered command history 112 113 file completion listbox: 114 ------------------------ 115 Return: replace incomplete path with listbox's current file 116 Control-Return: Same as return for first selection, but keep 117 the listbox active and append subsequent 118 selections to the commandline 119 Double-Button-1: same as Return 120 Tab: reset focus to the text entry widget 121 Control-v: toggle verbose on and off 122 Control-a: select all 123 Control-c: hide completions, leave commandline alone 124 Escape, Control-w,q: quit 125 126 command output textbox: 127 ----------------------- 128 Tab: reset focus to the text entry widget 129 Control-v: toggle verbose on and off 130 Control-c: hide output, leave commandline alone 131 Escape, Control-w,q: quit 132 133Future: 134------- 135* ability to toggle listbox independant of messages 136* configurable gravity so you can stick it at the bottom of the 137 screen and still see the verbose output 138* I may have figured out dynamic keybindings - soon to be configurable 139* `` syntax for shell output substitution? 140* persistant width resizing? or resized height becomes new max height? 141 feedback please! 142* write a man page 143* $PATH binary completion 144 145Bugs: 146----- 147* history limiting is only enforced at startup. This is probably 148 sufficient for most situations. 149* No substitutions implemented for history (nor will there be) 150* Even after a reorg, the code is still pretty ugly. 151* Running multiple copies of runit causes some screwy history 152 behavior - hopefully fixed. 153 154Changes: 155-------- 156 Since 0.92 157* Added autokill option to put PID's from backgrounded commands 158 into the command entry widget in the form "kill $PID" 159* History view now scrolls to the bottom by default 160* Clicking in output window or file completion listbox now sets 161 focus to that widget. 162* Fixed (mostly) problem saving blank/cancelled commandlines as empty 163 strings 164* Fixed (I hope) problem sometimes not saving recent history items 165 across multiple instances 166* Mouseloc option now makes sure that the window shows up entirely 167 on the screen 168 169 Since 0.90 170* tweaked Control-c binding in message widget so that toggling 171 verbose doesn't bring back cancelled output. 172* added Shift-Tab binding to entry widget which transfers focus 173 to the other displayed widget (command output or completions) 174* --mouseloc switch to pop up window under the mouse 175* fixed and improved label updating - hadn't used it in so long 176* cursor now starts at the end of the text in the entry widget 177 at startup 178* better output behavior in general 179 180 Since 0.85 181* squashed bug where a non-wildcard parameter following a wildcard 182 parameter would be appended without a space to the preceding 183 parameter, resulting in a bogus commandline 184* added more complete color configuration for those with 185 truly bizarre taste. 186* fixed (please test) the manual resizing bug. Now the window 187 will properly resize itself after manual fiddling. The new 188 size will NOT be persistant. 189 190 Since 0.82 191* squashed showlabel initialization bug 192* squashed expanding label bug/artifact 193* tilde and environment variables properly expanded in execution 194* interactive environment variable selection in verbose mode (like files) 195 196 Since 0.80 197* cursor at end of line after filename disambiguation 198* added ESC to quit keybindings 199* turned Control-c into context-specific cancel instead of quit 200* squashed startup w/o history bug 201* switch to turn off the verbose label (it started annoying me) 202* new verbose highlightcolor to indicate verbose is active in case 203 you run tkRunIt without a titlebar like I do 204* +w, ++wait, +p, ++persistant for turning off the related values 205* -l, --location for position geometry (the tcl interpreter steals 206 -g, --geometry unless you use --) 207* pipes can now be used without surrounding spaces 208* wildcard command execution courtesy of ToyKeeper 209* multiple command execution with semicolons 210* cd now handled as an internal command as in a shell 211 212 Since 0.77 213* cleaned up internals to make the code more managable and reduce 214 nasty side effects 215* disabled text entry in the output text widget - selecting still works 216* multiple file selection in the listbox via the keyboard 217* initial matched substring for ambiguous file patterns is now inserted! 218* !!! displays complete numbered history 219* history size now enforced at startup 220* commands with trailing "&" without a space are now handled properly 221* wish now started via sh, simplifying installation procedure 222 223 Since 0.76 224* filenames with embedded spaces are now handled properly 225* filenames in the completion listbox are now sorted 226* a couple more keybindings in the command output widget 227 228 Since 0.75 229* turned extended selection on in the listbox and mapped Control-a 230 to select-all 231* made sure that multiple selections would be properly substituted 232 into the commandline 233* replaced mesg widget output with scrollable text box 234 235 Since 0.70 236* matched width of listbox to that of entrybox (assuming fonts are the 237 same) rather than to the widest item in the list 238* added options for setting fonts and widths for entry box and listbox 239* added default selection to listbox so hitting return before 240 making a selection (or tabbing out) doesn't give an error 241 242 Since 0.65 243* status line and catching command output and posting to message box 244* listbox for ambiguous file completion 245* commandline switches in GNU format 246 247 Since 0.60 248* entry widget cleared after command execution 249 while persistent 250 251 Since 0.51 252* improved bad-file-completion selection heuristic 253* fixed bug in ! history matching 254* rcfile 255* -wait and -persistent 256 257Acknowledgements: 258----------------- 259Thanks to ToyKeeper (Scott Scriven <scriven@cs.colostate.edu> 260for his wildcard command execution patches and comments. 261And thanks to everyone who's given bug and feature feedback - that's 262what keeps me motivated to release. 263 264License: 265-------- 266This program is distributed under the GNU public license. 267Please see the LICENSE file accompanying this distribution 268for details. 269 270