You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the purpose of this will be to store some sort of global stack to have a unified interface for undoing (and redoing..?) shell actions. a couple ideas in mind for undoing things:
this will be stored in the form of a stack (or would it be a delayed fifo?)
there are 2 ways it can operate:
5s after an action is pushed (of course time configurable), it is actually performed. this can be done easily via timeout api
before truly exiting the shell, just perform all actions one after the other
the expected functions for this interface:
push(action): pushes a new action to the list
pop(): pops the latest action
get(id): retrieve an action by its id
perform(id): perform the action that has the appropriate id
an action is a simple object that has the following properties/functions
performer: a function that will do the stated action. with the example of the history delete, this callback will actually run the hilbish.history.delete function or similar
undoer: if the action is not destructive and the person wants to undo, this callback will be called
id: a unique id to refer to the action
The text was updated successfully, but these errors were encountered:
the purpose of this will be to store some sort of global stack to have a unified interface for undoing (and redoing..?) shell actions. a couple ideas in mind for undoing things:
rm
commandthis will be stored in the form of a stack (or would it be a delayed fifo?)
there are 2 ways it can operate:
the expected functions for this interface:
push(action)
: pushes a new action to the listpop()
: pops the latest actionget(id)
: retrieve an action by its idperform(id)
: perform the action that has the appropriateid
an
action
is a simple object that has the following properties/functionsperformer
: a function that will do the stated action. with the example of the history delete, this callback will actually run thehilbish.history.delete
function or similarundoer
: if the action is not destructive and the person wants to undo, this callback will be calledid
: a unique id to refer to the actionThe text was updated successfully, but these errors were encountered: