shithub: docs.9front.org

ref: 57ab7c16d6486abf525203557dabe1eafb22de19
dir: /rio-tips-and-tricks.md/

View raw version
Rio tips and tricks
===================

Filename completion is available with CTRL+F. To go from anywhere back to the command prompt, use CTRL+B.
More information about shortcuts and keys in general is available in `rio(1)` and `keyboard(6)`.

Command `"` prints the last used command.
`""` _executes_ the last command.
Both accept an optional argument to match a command string, ie:

	term% touch /tmp/1
	term% lc /tmp
	1
	term% "
		term% lc /tmp
	term% ""
		term% lc /tmp
	1
	term% "" to
		term% touch /tmp/1
	term% "" l
		term% lc /tmp
	1

If there is a command you want to run repeatedly, it's easy to define a rc function and use it instead:

	fn t { mk && ./6.out some arguments here >log && grep something log }
	t

To change the function without having to search it in the window, run `whatis t`, then redefined it.
`ls /env/fn*` will show which functions are defined.

To clear the window from any text run `echo >/dev/text`.

If you need to snarf an output of some command, instead of outputting into the window and then using mouse,
consider doing it directly instead: `command arg arg >/dev/snarf`.

Want to do advanced searching on window's text? Run your favorite text editor on it: `sam /dev/text`.

Want to take a screenshot of a window, but no idea which id that window has? Try seaching by its label:
`grep sam /dev/wsys/*/label`. Replace the `label` in the path to `window` and take the screenshot:
`topng </dev/wsys/X/window >/n/mycoolblog.com/www/files/acme.png`.

When it gets difficult to work with too many windows on the screen, consider running `winwatch` and using one
nested `rio` per virtual "workspace". If you're into keyboard-controlled window managers with virtual
desktops, try out [riow](https://git.sr.ht/~ft/riow).