31 lines
854 B
Plaintext
31 lines
854 B
Plaintext
gmi100 (Gemini CLI protocol client written in 100 lines of ANSI C)
|
|
|
|
I tried to pack as much as possible in 100 lines of ANSI C. Initially
|
|
I struggled to fit simple TLS connection in such small space but
|
|
eventually I ended up with CLI client capable of efficient navigation
|
|
between capsules of Gemini space.
|
|
|
|
Useful function for .profile:
|
|
|
|
```
|
|
gmi100() {
|
|
trap : INT
|
|
\rm /tmp/file?????? &>/dev/null
|
|
cd && /usr/bin/gmi100 "$@"
|
|
cd - 1>/dev/null
|
|
trap INT
|
|
}
|
|
```
|
|
|
|
Explaining:
|
|
* Ignore SIGINT - keyboard interrupt (\C-c);
|
|
* Remove "temp files"¹ of gmi100;
|
|
* 'cd' without parameter refer to "HOME shell variable"²;
|
|
* 'cd -' goes to last directory that you stayed.
|
|
|
|
¹ all that is opened with gmi100 client
|
|
² see dash(1) or bash(1)
|
|
|
|
summa summarum: this function will does save history of gmi100 on $HOME
|
|
directory, no matter where it is running from.
|