[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interactive mode

From: Paul Kienzle
Subject: Re: Interactive mode
Date: Tue, 18 Jun 2002 09:23:49 -0400

On Sun, Jun 09, 2002 at 08:01:34PM -0500, Ravikiran Rajagopal wrote:
> Hello,
>   I am writing a KDE GUI interface for Octave. It runs Octave as a separate 
> process, and manipulates the stdin and stdout handles. The output is usually 
> given a pretty face before being shown to the user, or is exported to a LaTeX 
> format, etc. I have a few questions about how the output is handled. 
>   I prefer to force the Octave process to run interactively so that the users 
> may get their customized prompts. However, when run interactively, paging is 
> enabled, and this messes up my GUI. Is there a hook available by which I can 
> override pagination defaults after the user's ~/.octaverc file is read? I 
> cannot send commands to Octave at that point without confusing the user.

I have a hack for starting octave with an initial command and continuing in
interactive mode which I recently posted on octave-sources.  It creates a new
octave init file which sources the user's octaverc then executes the extra
command.  Here is an improved version:


#! /bin/sh

# Start octave with an initial command.

# This program is public domain.

# Check if the user has a special OCTAVE_INITFILE, or use default .octaverc

# Check if OCTAVE_INITFILE exists. If so, make sure that it is sourced as
# soon as we enter octave. Note that octave first processes ~/.octaverc
# then if it is different, ./.octaverc 

# Construct a replacement OCTAVE_INITFILE script which will contain the
# initial command.
SCRIPT=`mktemp $HOME/octXXXXXX` || exit 1

# The 'trap' command removes our script on exit.
trap "rm -f $SCRIPT" 0

# Reset OCTAVE_INITFILE in octave to protect against recursive calls.

# Populate our script file
cat > $SCRIPT <<EOF 

# Start octave using our script
OCTAVE_INITFILE=`echo $SCRIPT | sed -e "s|$HOME/||"`
octave --silent

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]