Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implemented browser echo for /osh/web JS console output

  • Loading branch information...
commit cb41e02a144b0bdfda0b3e43827353bdfc8f0c5a 1 parent e5c46d9
@mitotic authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 graphterm/otrace.py
View
9 graphterm/otrace.py
@@ -2349,7 +2349,7 @@ def parse(self, line, batch=False, here_doc=None):
elif self.get_web_path() and len(self.get_web_path()) >= self.web_interface.root_depth:
# Non-otrace command; handle using web interface
if Set_params["safe_mode"]:
- return ("", "Javascript console disabled in safe mode; set safe_mode False")
+ return ("", "Javascript console disabled in safe mode; cd /osh and set safe_mode False")
try:
self.web_interface.send_command(self.get_web_path(), line)
return ("_NoPrompt_", None)
@@ -5138,7 +5138,10 @@ def web_hook(cls, op_type, path, data):
if op_type == "stderr":
if oshell.repeat_interval:
oshell.set_repeat(None)
- oshell.std_output(data+"\n")
+ msg = data+"\n"
+ oshell.std_output(msg)
+ if OTrace.callback_handler:
+ OTrace.callback_handler.logmessage(None, msg)
if op_type == "stdout":
if oshell.repeat_interval:
@@ -5152,6 +5155,8 @@ def web_hook(cls, op_type, path, data):
data = ALT_SCREEN_OFFSEQ + data
data = data+"\n"+oshell.prompt1
oshell.std_output(data, flush=True)
+ if OTrace.callback_handler:
+ OTrace.callback_handler.logmessage(None, data)
except Exception:
pass
Please sign in to comment.
Something went wrong with that request. Please try again.