-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e77d77
commit 1a2a2ec
Showing
5 changed files
with
85 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
#!/usr/bin/env python | ||
|
||
import quo | ||
from quo import echo | ||
from quo.console import app, command | ||
from quo.prompt import Prompt | ||
|
||
session = quo.Prompt() | ||
session = Prompt() | ||
|
||
@quo.command() | ||
@quo.app("@prompt") | ||
@command() | ||
@app("--prompt") | ||
def main(prompt): | ||
quo.echo("(1/3) If you press meta-! or esc-! at the following prompt, you can enter system commands.") | ||
echo("(1/3) If you press meta-! or esc-! at the following prompt, you can enter system commands.") | ||
|
||
answer = session.prompt("Give me some input: ", enable_system_elicit=True) | ||
quo.echo(f"You said: {answer}") | ||
answer = session.prompt("Give me some input: ", system_prompt=True) | ||
echo(f"You said: {answer}") | ||
|
||
# Enable suspend. | ||
quo.echo("(2/3) If you press Control-Z, the application will suspend.") | ||
answer = session.prompt("Give me some input: ", enable_suspend=True) | ||
quo.echo(f"You said: {answer}") | ||
echo("(2/3) If you press Control-Z, the application will suspend.") | ||
answer = session.prompt("Give me some input: ", suspend=True) | ||
echo(f"You said: {answer}") | ||
|
||
# Enable open_in_editor | ||
quo.echo("(3/3) If you press Control-X Control-E, the prompt will open in $EDITOR.") | ||
echo("(3/3) If you press Control-X Control-E, the prompt will open in $EDITOR.") | ||
answer = session.prompt("Give me some input: ", enable_open_in_editor=True) | ||
quo.echo(f"You said: {answer}") | ||
echo(f"You said: {answer}") | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters