zsh-users
 help / color / mirror / code / Atom feed
* New to zsh: zle, regular expressions conditionals, printf, history across shells (Mac OS X, zsh-4.2.7)
@ 2008-12-05 17:45 Webb Sprague
  2008-12-05 17:50 ` Mikael Magnusson
  2008-12-10 14:34 ` Sebastian Stark
  0 siblings, 2 replies; 3+ messages in thread
From: Webb Sprague @ 2008-12-05 17:45 UTC (permalink / raw)
  Cc: zsh-users

Just discovered zsh!  Awesome!

Here is are the first of many silly questions:

1.  Is there a place where I can read some zle examples?  I want to
try to push some edits onto the buffer stack, but I can't figure out
how...  if I run % zle at the command line, I get a return code of 1
(bad, I think).  Also, if I run setopt, I get

(0) ~ [0]% setopt
         <197>
autocd
extendedglob
interactive
monitor
shinstdin
zle

2.  Is there a way to test regular expressions in [[ ]]?  Bash
introduced a "=~" notation recently, and I was wondering if there is
an equivalent thing.  Maybe globbing is as powerful as RE's, but I
would still like to be able to do [[ $x =~ '^header: ' ]] or some
such.

3.  I can't figure out printf (or 'print -f').  If I type % printf
"foobar" without any newline, the output disappears.  If I type %
printf 'foo: %s\n' bar, I get "[m' bar:~foo: bar" -- I don't
understand why the special characters, nor where to look to find out
about them.

4.  Finally, is there a way to share my history across open shells?

Thanks to the list, in advance, for your patience.  Looking forward to
playing with zsh!


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

* Re: New to zsh: zle, regular expressions conditionals, printf, history across shells (Mac OS X, zsh-4.2.7)
  2008-12-05 17:45 New to zsh: zle, regular expressions conditionals, printf, history across shells (Mac OS X, zsh-4.2.7) Webb Sprague
@ 2008-12-05 17:50 ` Mikael Magnusson
  2008-12-10 14:34 ` Sebastian Stark
  1 sibling, 0 replies; 3+ messages in thread
From: Mikael Magnusson @ 2008-12-05 17:50 UTC (permalink / raw)
  To: Webb Sprague; +Cc: zsh-users

2008/12/5 Webb Sprague <webb.sprague@gmail.com>:
> Just discovered zsh!  Awesome!
>
> Here is are the first of many silly questions:
>
> 1.  Is there a place where I can read some zle examples?  I want to
> try to push some edits onto the buffer stack, but I can't figure out
> how...  if I run % zle at the command line, I get a return code of 1
> (bad, I think).  Also, if I run setopt, I get

The zle builtin command can only be used from bound widgets. Maybe you
want print -z?

> 2.  Is there a way to test regular expressions in [[ ]]?  Bash
> introduced a "=~" notation recently, and I was wondering if there is
> an equivalent thing.  Maybe globbing is as powerful as RE's, but I
> would still like to be able to do [[ $x =~ '^header: ' ]] or some
> such.

Yes, =~

> 3.  I can't figure out printf (or 'print -f').  If I type % printf
> "foobar" without any newline, the output disappears.  If I type %
> printf 'foo: %s\n' bar, I get "[m' bar:~foo: bar" -- I don't
> understand why the special characters, nor where to look to find out
> about them.

No idea here.

> 4.  Finally, is there a way to share my history across open shells?

setopt sharehistory histappend
should probably do it

-- 
Mikael Magnusson


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

* Re: New to zsh: zle, regular expressions conditionals, printf, history across shells (Mac OS X, zsh-4.2.7)
  2008-12-05 17:45 New to zsh: zle, regular expressions conditionals, printf, history across shells (Mac OS X, zsh-4.2.7) Webb Sprague
  2008-12-05 17:50 ` Mikael Magnusson
@ 2008-12-10 14:34 ` Sebastian Stark
  1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Stark @ 2008-12-10 14:34 UTC (permalink / raw)
  To: zsh-users


On 05.12.2008, at 18:45, Webb Sprague wrote:
> 3.  I can't figure out printf (or 'print -f').  If I type % printf
> "foobar" without any newline, the output disappears.  If I type %
> printf 'foo: %s\n' bar, I get "[m' bar:~foo: bar" -- I don't
> understand why the special characters, nor where to look to find out
> about them.

Perhaps you have a preexec function defined that sets your xterms  
title using an escape sequence, it probably looks like this:

  print -n "\e]2;$mytitle\C-g"

If that's true you can fix your problem by changing this to:

  print -n "\e]2;${(q)mytitle}\C-g"


Sebastian


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

end of thread, other threads:[~2008-12-10 14:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-05 17:45 New to zsh: zle, regular expressions conditionals, printf, history across shells (Mac OS X, zsh-4.2.7) Webb Sprague
2008-12-05 17:50 ` Mikael Magnusson
2008-12-10 14:34 ` Sebastian Stark

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).