Content deleted Content added
-mounting: irrelevant; +explain start_fish_server; copyedit; +set of utils; +manage files. |
+protocol messages;+session initiation |
||
Line 4:
The protocol was designed by Pavel Machek in [[1998]] for [[Midnight Commander]].
==Protocol messages==
Client sends text requests of the following form:
#FISH_COMMAND arguments...
equivalent shell commands,
which may be multi-line
Fish commands are all defined, shell equivalents may wary.
Fish commands always have priority: server is expected to execute fish command if it understands it. If it does not, however, it can try the luck and execute the shell command.
Server replies are multi-line, but always end with
### xyz<optional text>
line. <tt>###</tt> is a prefix to mark this line, <tt>xyz</tt> is the return code.
Return codes are superset to those used in [[ftp]].
The codes 000 and 001 are special, their meaning depends on presence of server output before the end line.
==Session initiation==
The client initiates SSH or RSH connection with <tt>echo FISH:;/bin/sh<tt> as the command executed on remote machine. This should make it possible for the server to distinguish FISH connections from normal RSH or SSH.
The first two commands sent to the server are <tt>FISH</tt> and <tt>VER</tt> to negotiate FISH protocol, its version and extensions.
#FISH
echo; start_fish_server; echo '### 200'
#VER 0.0.2 <feature1> <feature2> <...>
echo '### 000'
The server may reply to VER command with a lines like
VER 0.0.0 <feature2> <...>
### 200
which indicates supported version of the FISH protocol and supported extensions.
==Implementations==
|