help-octave
[Top][All Lists]
Advanced

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

Re: cant' set PS1 after restart on Mac


From: DushanM
Subject: Re: cant' set PS1 after restart on Mac
Date: Wed, 10 Oct 2007 10:53:39 -0600
User-agent: MacSOUP/2.8.1 (Mac OS X version 10.4.10 (x86))

John W. Eaton <address@hidden> wrote:

> On  9-Oct-2007, DushanM wrote:
> 
> | On Mac OS X.4.10 I had Octave 2.9.14 running with the prompt modified to
> | read
> | 
> |     PS1 ('\n*** \s:\#\$\n=> ')
> | 
> | and had saved that variable to a file (~/octave/Oprompt.def).  Then
> | quit octave and the terminal, installed an EFI firmware update, shut
> | down, and rebooted (the install was successful).
> | 
> | Everything seemed to be fine, and the newly invoked octave included
> | the path to ~/octave that I had added previously.  Then I tried to
> | load PS1 from the saved value in Oprompt.def, and octave made no
> | objection, but just returned with the default prompt:
> | 
> |     octave-2.9.14:1> load ~/octave/Oprompt.def PS1
> |     octave-2.9.14:2> PS1
> |     PS1 = \n*** \s:\#\$\n=> 
> | 
> | Puzzled, I entered it by hand and got:
> | 
> |     octave-2.9.14:6> PS1 ('\n*** \s:\#\$\n=> ') 
> |     error: invalid vector index = 115
> | 
> | No variation of this did any better.  Any idea what I'm doing wrong
> | here?
> 
> PS1 is a function, not a variable.

That misunderstanding was my problem.  I did a 'clear all', issued

    old_val = PS1(\n*** \s:\#\$\n=> )

and the new prompt worked.  Thanks.

BTW, I always wondered why people often put a space between the function
name and its arguments.  I haven't noticed it making a difference.

> | One more question:  I made the Terminal prompt a different color
> | for visibility, like this (in bashrc):
> | 
> |     PS1='\n\[\e[1;34m\][\w]\[\e[0m\]\$\n=> '
> | 
> | Is it possible to add color to the Octave prompt as well?  It wasn't
> | clear how to do that from the docs.
> 
> I think
> 
>   PS1 ('\n\[\e[1;34m\][\w]\[\e[0m\]\$\n=> ');
> 
> will work in the upcoming 2.9.15 snapshot.

Great, I'm looking forward to it. 

- Dushan


reply via email to

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