zsh-workers
 help / color / mirror / code / Atom feed
* alwayslastprompt problem
@ 2003-02-03 22:05 Greg Klanderman
  2003-02-04  2:57 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Greg Klanderman @ 2003-02-03 22:05 UTC (permalink / raw)
  To: Zsh list


Hi,

In upgrading to zsh 4.0.6 I noticed the following problem:
When run, the script below does not obey alwayslastprompt.

---
#!/phl/build/zsh-4.0.6/Src/zsh -f

setopt alwayslastprompt

prompt="foo%B%%%b "
while cmd="" && vared -h -p "$prompt" cmd ; do 
  echo " -- got: $cmd"
  print -s - "$cmd"
done
---

However, if I run "zsh -f" and paste the contents, then
alwayslastprompt does work correctly (same zsh binary).

What's going on?  

Please include me in any reply as I am not on the list.

many thanks,
Greg


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: alwayslastprompt problem
  2003-02-03 22:05 alwayslastprompt problem Greg Klanderman
@ 2003-02-04  2:57 ` Bart Schaefer
  2003-02-04  4:26   ` Greg Klanderman
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2003-02-04  2:57 UTC (permalink / raw)
  To: greg, Zsh list

On Feb 3,  5:05pm, Greg Klanderman wrote:
} 
} What's going on?  

The alwayslastprompt option does not apply to non-interactive shells.  A
script is not "interactive", even if it calls "vared".  If the shell from
which you are calling the script is also zsh, try autoloading the script
as a shell function instead of running it as a separate process.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: alwayslastprompt problem
  2003-02-04  2:57 ` Bart Schaefer
@ 2003-02-04  4:26   ` Greg Klanderman
  2003-02-05 16:15     ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Greg Klanderman @ 2003-02-04  4:26 UTC (permalink / raw)
  To: Zsh list


Hi Bart,

Is there any reason zsh couldn't handle alwayslastprompt in this
situation?  The other completion options seem to work in this context.

Using a shell function is not really an option.  While I run zsh as my
interactive shell, others here do not.

I can certainly live without alwayslastprompt, but it would be
preferable... 

thanks to you and the other zsh workers for continuing to produce
such a truly incredible shell,
Greg



>>>>> Bart Schaefer <schaefer@brasslantern.com> writes:

> On Feb 3,  5:05pm, Greg Klanderman wrote:
> } 
> } What's going on?  

> The alwayslastprompt option does not apply to non-interactive shells.  A
> script is not "interactive", even if it calls "vared".  If the shell from
> which you are calling the script is also zsh, try autoloading the script
> as a shell function instead of running it as a separate process.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: alwayslastprompt problem
  2003-02-04  4:26   ` Greg Klanderman
@ 2003-02-05 16:15     ` Bart Schaefer
  2003-02-05 19:38       ` Greg Klanderman
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2003-02-05 16:15 UTC (permalink / raw)
  To: gak, Zsh list

On Feb 3, 11:26pm, Greg Klanderman wrote:
}
} Is there any reason zsh couldn't handle alwayslastprompt in this
} situation?

It appears to be an order-of-initialization issue.  In a non-interactive
shell, the terminal isn't set up until vared is actually invoked, and
for some reason that causes the ZLE refresh routines to believe that it
isn't possible to do alwayslastprompt.

I haven't figured out exactly what is different in the two cases.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: alwayslastprompt problem
  2003-02-05 16:15     ` Bart Schaefer
@ 2003-02-05 19:38       ` Greg Klanderman
  0 siblings, 0 replies; 5+ messages in thread
From: Greg Klanderman @ 2003-02-05 19:38 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh list


Interesting.. if you haven't figured it out I'll probably look 
into this sometime but not for at least a week or two.

greg


>>>>> Bart Schaefer <schaefer@brasslantern.com> writes:

> On Feb 3, 11:26pm, Greg Klanderman wrote:
> }
> } Is there any reason zsh couldn't handle alwayslastprompt in this
> } situation?

> It appears to be an order-of-initialization issue.  In a non-interactive
> shell, the terminal isn't set up until vared is actually invoked, and
> for some reason that causes the ZLE refresh routines to believe that it
> isn't possible to do alwayslastprompt.

> I haven't figured out exactly what is different in the two cases.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-02-05 19:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-03 22:05 alwayslastprompt problem Greg Klanderman
2003-02-04  2:57 ` Bart Schaefer
2003-02-04  4:26   ` Greg Klanderman
2003-02-05 16:15     ` Bart Schaefer
2003-02-05 19:38       ` Greg Klanderman

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).