Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -204,10 +204,12 @@ with gr.Blocks(
|
|
| 204 |
with gr.Column(scale=1, min_width=BUTTON_MIN_WIDTH):
|
| 205 |
btn_cmd = gr.Button("Run Command")
|
| 206 |
output_cmd = gr.Label("", label="Command Output") # Use gr.Label for simple text output
|
| 207 |
-
|
| 208 |
def on_button_click():
|
| 209 |
-
output_cmd.value = run_command(command_cmd.value) # Update value directly
|
| 210 |
-
|
|
|
|
|
|
|
|
|
|
| 211 |
btn_cmd.click(on_button_click)
|
| 212 |
|
| 213 |
|
|
|
|
| 204 |
with gr.Column(scale=1, min_width=BUTTON_MIN_WIDTH):
|
| 205 |
btn_cmd = gr.Button("Run Command")
|
| 206 |
output_cmd = gr.Label("", label="Command Output") # Use gr.Label for simple text output
|
|
|
|
| 207 |
def on_button_click():
|
| 208 |
+
output_cmd.value = run_command(command_cmd.value) # Update value directly
|
| 209 |
+
def on_enter_key(key):
|
| 210 |
+
if key == "enter":
|
| 211 |
+
on_button_click()
|
| 212 |
+
command_cmd.keypress(on_enter_key) # Add event listener for Enter keypress
|
| 213 |
btn_cmd.click(on_button_click)
|
| 214 |
|
| 215 |
|