The Text Editor
The plain text editor provided as an applet for
psh can be used to quickly
edit device configuration, remotely edit scripts (like Lua, Python, etc.)
directly on the device with Phoenix-RTOS or simply to take notes.
edit command is entered at the
psh prompt, hint message will be
Usage: edit <file name>
To start editing a new file, enter
file name as an absolute path or a path
relative to the file or just its name. The file will be created after saving it
^S. If the file already existed, it will be overwritten.
E.g. if the
config file already exists, executing the
edit config command
will start the text editor loading the
config file content.
Just start writing. An asterisk (
*) will appear on the status bar, right
side, next to the
Insert/Replace mode indicator when the file status becomes
dirty. To delete a single letter in front of the cursor, use the
key or to delete the character behind the cursor use the
You may wish to delete rows one by one to do so use
D key, instead of
Backspace through long line - this feature becomes handy on 9600bps
When editing move the cursor with the arrow keys:
Page Up and
Page Down to scroll one terminal screen height. To
reach the end of the current line, press
Home to move the cursor to
the beginning of the current line.
The current cursor position is shown on the right side of the status bar (for
[18:8]), indicating the eighteenth row and eighth column.
By default tab stop is set to 4 characters. To enter
\t character press
key on your keyboard, the text will be adjusted using current tab stop setting.
Saving or exiting without saving
To exit the editor press
Q (indicated as
^Q in the key description
bar). When a file is in a dirty state, an appropriate warning will be
displayed in the status/message bar when closing the editor to save the file or
abandon the changes.
To save your work press
S (or as indicated
^S) but if for some
reason you decide to quit without saving, press
will allow you to finish gracefully and abandon your edits.
While editing the text, you can switch between the mode of replacing and
inserting characters, to do this press the
Insert key, the selected mode will
be indicated on the right side of the status bar with the letter
Sometimes it is necessary to completely redraw the entire screen of the text
editor when the serial connection has been interrupted or disconnected and the
editor has not been closed (remains running) or the size of the remote terminal
has changed (using serial connections we are not aware of signals like
SIGWINCH to automatically handle redraw and get the current dimensions of the
remote terminal, you need a special query procedure) in such cases press
^L) this will update the editor screen quickly.