mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-06 01:12:27 +00:00
Fix the prompt behavior if terminal is not tty
This commit is contained in:
@@ -73,10 +73,13 @@ def disc_menu():
|
||||
# Loop forever and ever
|
||||
while True:
|
||||
# Get input command from user
|
||||
as_input = session.prompt(
|
||||
f"{get_flair()} (disc)> ",
|
||||
completer=word_completer,
|
||||
)
|
||||
if session:
|
||||
as_input = session.prompt(
|
||||
f"{get_flair()} (disc)> ",
|
||||
completer=word_completer,
|
||||
)
|
||||
else:
|
||||
as_input = input(f"{get_flair()} (disc)> ")
|
||||
|
||||
# Parse fundamental analysis command of the list of possible commands
|
||||
try:
|
||||
|
||||
@@ -4,4 +4,8 @@ from prompt_toolkit import PromptSession
|
||||
from prompt_toolkit.history import FileHistory
|
||||
|
||||
history_file = os.path.join(os.path.expanduser("~"), ".gamestonk_terminal.his")
|
||||
session = PromptSession(history=FileHistory(history_file))
|
||||
|
||||
try:
|
||||
session = PromptSession(history=FileHistory(history_file))
|
||||
except Exception as e:
|
||||
session = None
|
||||
|
||||
Reference in New Issue
Block a user