From owner-bug-octave at bevo dot che dot wisc dot edu Wed Jan 22 21:19:52 1997 Subject: How to run octave through remsh? From: "John W. Eaton" To: Francesco Potorti` Cc: Octave bugs list Date: Wed, 22 Jan 1997 21:18:44 -0600 On 2-Jan-1997, Francesco Potorti` wrote: : I used to run octave 1 in a rlogin window inside emacs. I invoked it : with `remsh sable bin/octave'. For misterious reasons it didn't give : me a prompt, but for the rest everything was okay. If I tried the -i : option, it echoed my keystrokes twice, so I preferred to have no : prompt. : : Octave 2.0 behaves differently. It will write in batches. For : example, this is the trace of an emacs rlogin session: : Octave, version 2.0 (alpha-dec-osf3.0). : Copyright (C) 1996 John W. Eaton. : This is free software with ABSOLUTELY NO WARRANTY. : For details, type `warranty'. : : 1 : 2 : 3 : l : error: `l' undefined near line 4 column 1 : error: evaluating expression near line 4, column 1 : ans = 1 : ans = 2 : ans = 3 : : : While this is the trace when octave is called with the -i option: : : Octave, version 2.0 (alpha-dec-osf3.0). : Copyright (C) 1996 John W. Eaton. : This is free software with ABSOLUTELY NO WARRANTY. : For details, type `warranty'. : : 1 : 2 : 3 : l : error: `l' undefined near line 4 column 1 : error: evaluating expression near line 4, column 1 : octave:1> octave:1> octave:1> : octave:1> 1 : ans = 1 : octave:2> octave:2> 2 : ans = 2 : octave:3> octave:3> 3 : ans = 3 : octave:4> octave:4> l : : Is there any way to use octave 2.0 in the way I am used to? Please try the following patch. I think it will allow you to get the behavior you want if you use the -i option when running Octave. Thanks, jwe Wed Jan 22 20:54:12 1997 John W. Eaton * input.cc (gnu_readline): If not using readline, flush rl_outstream after printing prompt. (octave_gets): Also call flush_octave_stdout() if forced_interactive, not just if interactive. (do_input_echo): If forced_interactive, only echo prompt and command line if also reading a script file. Index: input.cc =================================================================== RCS file: /home/jwe/src/master/octave/src/input.cc,v retrieving revision 1.90 diff -c -r1.90 input.cc *** input.cc 1996/11/05 21:46:06 1.90 --- input.cc 1997/01/23 03:09:43 *************** *** 387,393 **** { int do_echo = reading_script_file ? (Vecho_executing_commands & ECHO_SCRIPTS) ! : (Vecho_executing_commands & ECHO_CMD_LINE); if (do_echo) { --- 387,393 ---- { int do_echo = reading_script_file ? (Vecho_executing_commands & ECHO_SCRIPTS) ! : (Vecho_executing_commands & ECHO_CMD_LINE) && ! forced_interactive; if (do_echo) { *************** *** 430,436 **** else { if (s && *s && (interactive || forced_interactive)) ! fprintf (rl_outstream, s); FILE *curr_stream = rl_instream; if (reading_fcn_file || reading_script_file) --- 430,439 ---- else { if (s && *s && (interactive || forced_interactive)) ! { ! fprintf (rl_outstream, s); ! fflush (rl_outstream); ! } FILE *curr_stream = rl_instream; if (reading_fcn_file || reading_script_file) *************** *** 493,503 **** string prompt = decode_prompt_string (ps); ! if (interactive) ! { ! pipe_handler_error_count = 0; ! flush_octave_stdout (); ! } octave_diary << prompt; --- 496,504 ---- string prompt = decode_prompt_string (ps); ! pipe_handler_error_count = 0; ! ! flush_octave_stdout (); octave_diary << prompt;