This repository has been archived by the owner on Mar 25, 2023. It is now read-only.
fpm shell
#720
amitu
started this conversation in
Ideas & RFC
`fpm shell`
#720
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
fpm shell >> -- ftd.text: hello world
This starts a server and opens it in browser.
In browser Edit Mode
Since user will be mostly interacting with the UI in browser, the shell can also be used from browser.
Pressing Shift-Shift launches the shell in the last hand side in the browser. The preview is in the right hand side.
special commands
FTD lines start with
--
. Special commands start without--
.clear
Clears the browser, all rendered UI is cleared. All memory still remains. If some event handler was not bound to UI (say a timer), it may persist.
reset
Clears the UI and the variables etc. As if we started the session from scratch.
open
If you have closed the browser window/tab this command will open it again.
print
This will print the value of the variable if
<name>
is a variable. For record, component etc it will print information about them.write
This will whiteout the shell in a file.
Any content cleared using
clear
orreset
will not be written in the file.read
This will read a file in memory.
Continuation
For most commands eg
-- ftd.text: foo
more lines may be expected, so we show partially rendered content in browser, but keep the user in "continuation mode":fpm shell >> -- ftd.text: hello ..
Notice the two dots, this indicates we are in the continuation mode. If we have to provide more values, we will provide here, else we can press enter to "finish" the section.
Auto Closing
For open components, we will auto close them to make them valid. Eg
When user has just typed this, we will auto close the column so we can see the column.
Editing Past Commands
One problem with shells usually is editing past commands. We want to make it easy, so instead of using a readline based UI, where past commands are just "printed", and we can not go back and edit them. We want something like python notebook but on terminal.
We can do this by making this a curses based UI, where we are rendering the entire screen, and scrolling using up/down arrows are controlled by us.
We will give
Beta Was this translation helpful? Give feedback.
All reactions