Scroll to navigation

VF1(1) General Commands Manual VF1(1)

NAME

vf1command line gopher client

SYNOPSIS

vf1 [-h][--bookmarks][--debug][--tls][url...]

DESCRIPTION

vf1is an interactive command line gopher client.It presents a prompt to the user, who can then enter commands to performactions.

Only a small number of commands are needed to get around, and most ofthem can be abbreviated to one or two chars, so with practice very quicknavigation of gopherspace is possible.See theCOMMANDSsection for more details.

The options are as follows:

,--help
Display a short help message and exit.
Immediately navigate to bookmarks upon starting.
Start with debug mode enabled.
Start in TLS mode.See theTLS MODEsection for more details.
url...
The Gopher URL(s) to open.If more than one URL is provided, these are queued in atour.

COMMANDS

Allvf1commands are listed below.Most commands operate on an implicit operand from the very limited internalstate whichvf1maintains.

This state includes the“lookup,”which is a list of items (locations) in Gopherspace with numeric indicesattached.Indices begin from 1.Upon startup, the lookup is empty.Whenever a gopher menu is visited, the contents of that menu become thecontents of the lookup, replacing any previous contents.Some commands, such assearch,history,orlinksoverwrite the lookup with their results.At any time, the lookup can be reset to the contents of the most recentlyvisited gopher menu with thelscommand.

In addition to the lookup,vf1is aware of exactly one active item (the item the user is currently viewing).Usually, the active item is one of the items in the lookup, and if sovf1knows its index.

Mostvf1commands operate on either the lookup, or the active item.

In addition to the commands listed below, users can enter a numeric index.vf1will then navigate to the corresponding item in the lookup, and that item willbecome the active item.

,add
Add the URL of the current item to the bookmarks menu.
,back
Go back to the previous item in the history.
,blackbox
Display contents of flight recorder, showing statistics for the current gopherbrowsing session.
,book,bookmarks
Show the current bookmarks menu.
Process the text of the current item with thecat(1)command.
Exit VF-1.Go forward to the next item in the history.
,fold
Process the text of the current item with thefold(1)command, wrapping lines at 70 characters.
,forward
Go forward to the next item in the history.
,gourl|mark
Visit a gopher URL or marked item, making it the active item.
[mimetypeprogram]
List or set handlers for different MIME types.SeeHANDLERSsection below for more details.
[command]
Display help information for a command, or list all commands with helpinformation available.
,hist,history
Display the history.
,less
Process the text of the current item with theless(1)command.
,links
Extract URLs from the text of the current item, and populate the lookup withthem.
[-l]
Set the lookup to the contents of the most recently visited gopher menu andthen list the lookup's contents.If invoked asls -lthe listing will include the URL of each menu item.
,mark[mark]
Mark the current item with a single letter.This letter can then be passed to thegocommand to return to the current item later.Lists all defined marks when no argument is given.
,next
Go to the item which is after the current item in the lookup.
,prev, previous
Go to the item which is before the current item in the lookup.
,quit
Exit VF-1.
,reload
Reload the current item.
Visit the root gopher item of the server hosting the current item.
,save[filename]
Save an item to the filesystem.savesaves the current item with an automagic filename derived from its gopherselector.savefilenamesaves the current item with the specified filename.savensaves the item at lookup index n with an automagic filename.savenfilenamesaves the item at lookup index n with the specified filename.
,se,searchpattern
Search the lookup (case insensitive).
[optionvalue]
Change the value of a setting, or view its current value.Shows all current value options if no arguments are given.See theSETTINGSsection below for more details.
Toggle TLS mode on or off.See theTLS MODEsection for more details.
,tour[item...]
Visit the next item in, or add an item to, the“tour”- a FIFO queue of gopher items.If no arguments are provided, the next item in the tour is visited.Items from the lookup can be added with a list of indices liketour1 2 3 4,or consecutive ranges liketour1-4.All items in the lookup can be added withtour*.Items not in the lookup can be added by their URL withtoururl.The current tour queue can be listed withtourlsand scrubbed withtourclear.
,u
Go up one directory in the path.
Show the URL of the current item.
,veronica[query]
Submit a search query to the Veronica 2 search engine.

HANDLERS

vf1uses external programs as“handlers”to present different gopherspace content to the user.Even when visiting a plain text file with item type 0,vf1uses (bydefault) the unix commandcat(1)to display that file on the screen, rather than using a Python()call.Users have full control over which external programs are used for differentcontent, so the user experience can be customised to taste.

Handlers are assigned on the basis of MIME types.The gopher protocol has no concept of MIME type, sovf1assigns each item a MIMEtype itself in the manner described in the sectionMIME type assignmentbelow.

A list of the current handler assignments can be viewed at any time by runningthehandlercommand.The default handlers that ship withvf1are:

application/pdf: xpdf %s
audio/mpeg: mpg123 %s
audio/ogg: ogg123 %s
image/*: feh %s
text/*: Ta cat %s
text/html: lynx -dump -force_html %s

Thehandlercommand can be used to change these handlers, or set handlers for new MIMEtypes.For example, users who preferw3m(1)overlynx(1)for handling HTML content could run:

VF-1> handler text/html w3m -dump %s

The specified handler will be run as a shell command, with the temporary filecontaining the content of the current gopher item replacing any occurrences of%s.Pipe syntax can be used to pass gopher content through multiple textfilters to achieve the desired appearance.

The‘*’wildcard can be used when specifying handler MIME types, e.g.‘image/*’allows using a single program to handle any kind of image.Handlers without wildcards take precedence over handlers with wildcards.In other words, if one handler is specified for‘image/jpeg’and a different handler for‘image/*’,the‘image/jpeg’handler will be used for JPEGs and the‘image/*’handler will be used for all other images.

MIME type assignment

vf1assigns MIME types to gopher items as follows:

  • Item types 0 and 1 are assigned MIME type‘text/plain
  • Item type h is assigned MIME type‘text/html
  • Item type g is assigned MIME type‘image/gif

For all other item types,vf1attempts to guess a MIME type from the fileextension of the last component of the selector, using the‘mimetypes’module from the Python standard library.This usually results in a reliable identification assuming the file has anextension and the author of the gopher content is not being deliberatelydeceptive.

If the selector has no file extension, or the extension is notrecognised by the‘itemtypes’module,vf1will use the unix programfile(1)to attempt to guess a MIME type by actually inspecting the content ofthe file.

In accordance with the idea that gopher item types, which are astandard part of the protocol, should take precedence over any otherattempt at inferring MIME type, which is not a standard part of theprotocol, if an item in gopherspace is listed with itemtype‘I’or‘s’and one of the above methods returns a MIME type which does not beginwith‘image/’or‘sound/’respectively,vf1will default to‘image/jpeg’or‘audio/mpeg’respectively.This should only happen in highly unusual circumstances and suggests a poorlyor maliciously configured gopher server.

TEXT ENCODING

vf1attempts to decode the content received for any text-based itemtypes (e.g. 0, 1, 7, h) as UTF-8.Most content in gopherspace is ASCII-encoded, and since UTF-8 is backwardcompatible with ASCII, this will generally“just work”.If the received contentbe decoded as UTF-8, one of two possible things will happen:

If the‘chardet’Python module is installed,vf1will use it to attempt toautomatically detect the encoding used and decode the text appropriately.Note that pip etc. will not install‘chardet’automatically when installingvf1,asvf1does not formally depend on‘chardet’.It uses it opportunistically, so that it can still be easily installedand used on systems where‘chardet’is not or cannot be installed.

If‘chardet’is not installed, or if‘chardet’cannot identify an encoding with confidence exceeding 0.5,vf1will attempt tofall back to a single, user-specified alternative encoding.This encoding can be set as follows:

VF-1> set encoding koi8-r

The default fall back encoding is iso-8559-1, which is used by thepopular gopher sitefloodgap.com.Users who routinely visit gopher sites encoded with some other encoding mayconsider using an RC file (see below) to automatically set the alternativeencoding at start up.

TLS MODE

vf1supports TLS connections.This is an experimental feature, and TLS connections are not supported by themajority of gopher servers.As such, TLS support must be explicitly activatd by using thecommand to enable TLS mode (aka "Battloid mode").When TLS mode is enabled,gopher requests will be made over TLS, so mostrequests will fail when a connection to the server cannot be established.TLS mode must be explicitly deactivated to resume browsing unencryptedgopherspace.

SETTINGS

The following miscellaneous settings can be adjusted with thecommand.

If set to true, items in gopher menus will be color coded according to itemtype, using ANSI escape codes.Default value is false.
If set to true, detailed debugging information will be printed to stdout whencommands are run.Default value is false.
Fallback text encoding to use if received gopher content cannot be decoded asUTF-8.See theTEXT ENCODINGsection for more details.Default value is iso-8859-1.
If set to true,vf1will preferentially attempt to connect to gopher servers via IPv6 if a AAAA DNSrecord is found.If the IPv6 connection fails,vf1will automatically retry with IPv4.Default value is true.
Time to wait, in seconds, when trying to connect to a gopher server beforegiving up.Default value is 10.

FILES

~/.vf1-bookmarks.txt
This file stores gopher bookmarks, in a simple gophermap format (without hostsor ports).Useaddto add the current URL to the bookmark list.
~/.config/vf1/vf1rc
 
~/.config/.vf1rc
 
~/.vf1rc
Upon startup,vf1will search for a file with one of these names, a so-called RC file(see below).The names are listed above in order of preference andvf1will stop after the first one it finds, e.g. if both~/.config/vf1/vf1rcand a~/.vf1rcexist then then~/.vf1rcwill be ignored.

RC FILE

If an RC file is found, each line of the file will be executed as avf1command before the prompt is displayed.This allows users to scriptcertain commands that should be run every timevf1is started.This permits, for example:

  • Permanently configuring item type handlers by puttinghandlercommands in the RC file.
  • Permanently configuring the preferred non-UTF-8 encoding, or otheroptions, by puttingsetcommands in the RC file.
  • Setting a“home page”by putting agocommand in the RC file.
  • Starting a tour through a list of favourite sites by puttingtourcommands in the RC file.

EXAMPLES

See thevf1-turorial(7)for a comprehensive introduction to the work flow ofvf1

Startvf1:

vf1

Startvf1and immediately open to bookmark list:

vf1 --bookmarks

Visit the zaibatsu:

vf1 zaibatsu.circumlunar.space

SEE ALSO

vf1-tutorial(7)

STANDARDS

vf1is a gopher client conforming to RFC 1436⟨https://tools.ietf.org/html/rfc1436⟩.

TRIVIA

vf1is named after the VF-1 Valkyrie aircraft from the classic '80s anime seriesSuper Dimension Fortress Macross, in recognition of the role that the SDFPublic Access Unix system⟨gopher://sdf.org⟩,named after the same series, has played in keeping Gopherspace alive in the21st century.

AUTHORS

Solderpunk<solderpunk@sdf.org>
Alex Schroeder<alex@gnu.org>
Joseph Lyman<tfurrows@sdf.org>
Adam Mayerhttps://github.com/phooky
Paco Esteban<paco@onna.be>

August 31, 2019 All Operating Systems