Leander Jedamus | 9 Feb 19:37
Picon
Gravatar

issue with cursor down bindkey setting

Hi!

I have some problems setting the arrow keys inside zsh. What I do is:
$ bindkey "$terminfo[cuu1]" history-substring-search-up
$ bindkey "$terminfo[cud1]" history-substring-search-down

The first command works as expected, the second does not, because 
$terminfo[cud1] is bound to ^J, not to ^[[B

$ bindkey "$terminfo[cuu1]"
"^[[A" history-substring-search-up
$ bindkey "$terminfo[cud1]"
"^J" history-substring-search-down

So where is the assoziative array terminfo set? Can I change that?

Thanks in advance
Leander Jedamus

TJ Luoma | 1 Feb 00:55
Picon
Gravatar

Arrays with each item on one line

I don't understand arrays very well and am trying to learn.

I keep trying to do things like this:

FILES=("$HOME/Library/Application Support/Keyboard Maestro"
"$HOME/Library/Preferences/com.stairways.keyboardmaestro.editor.plist"
"$HOME/Library/Preferences/com.stairways.keyboardmaestro.engine.plist"
"$HOME/Library/Preferences/com.stairways.keyboardmaestro.plist")

for F in $FILES
do

command ls -ld "$F"

done

but instead of $F being each line for 4 iterations of the loop, I get
all 4 lines x 4 times.

I thought that the solution was changing IFS, so I tried:

IFS='
'

and

IFS=$'\n'

but that doesn't seem to change anything.

(Continue reading)

Jay Levitt | 30 Jan 17:56
Picon

zsh, compinit and ownership

I have zsh installed on my Mac via homebrew, which expects packages to
live under /usr/local and be owned by the primary user (in my case,
user "jay").  But I think zsh expects its sitewide directories to be
owned by root and only root.  So with ownership like:

drwxr-xr-x  3 jay  staff   102B Oct  1 16:12
/usr/local/Cellar/zsh/4.3.12/share/zsh/site-functions/

I get the following with "sudo -s":

% sudo -s
Password:
zsh compinit: insecure directories and files, run compaudit for list.
Ignore insecure directories and files and continue [y] or abort compinit [n]? n
compinit: initialization aborted

Is there a way around this conflict, to tell zsh "No, trust me, it's
ok to be owned by jay"?  Or is the only solution to teach homebrew to
have that folder owned by root?

See also:

 https://github.com/mxcl/homebrew/issues/7801#issuecomment-2187273

Jay

Yuri D'Elia | 23 Jan 20:51
Gravatar

"Literal" command execution

Hi everyone.

I'm trying to reduce some typing here, as usual ;).
I have a command line logger that allows free text as its main arguments (random example: taskwarrior). A
typical example might be:

  command log [free text follows]

I want to reduce escaping to the bare minimum. Dollars are not really a problem, but I discovered myself to
escape '<' '>' and '!' too often.

Of course I am already aware of both noglob and nocorrect, but I would need something more extreme, as in
"feed whatever text, including #, etc, that follows the command as arguments".

Is there any way to achieve that?
Maybe by some rewriting trick?

Larry Schrof | 18 Jan 21:20

Can we have an additional output option for setopt?

I can appreciate the logic that goes into displaying the 'no' prefix in the output of setopt. (As it pertains
to defaults and minimizing the amount of output.)

However, I find myself often wanting to see every option listed by raw name, along with it's current state.
And I don't care about the defaults; I'd like to see the list without the 'no' prefixes polluting the output.

I originally set KSH_OPTION_PRINT, and got this as the first few lines of output:

noaliases             off
allexport             off
noalwayslastprompt    off
alwaystoend           on
...

This is CLOSE to what I want, but what I really would like to see instead is this:

aliases               on
allexport             off
alwayslastprompt      on
alwaystoend           on
...

Could we consider adding in this functionality? I'll leave it up to the devs to decide how this
functionality gets turned on and off, but part of me is thinking it should maybe be an option, perhaps
called 'OPTION_PRINT_VERBOSE' or something like that...

Micah Elliott | 11 Jan 21:52
Gravatar

Extended attributes (module and article)

Hi! I was peeking at the `zsh/attr` module docs and trying to figure
out why it exists. Is it significantly different from the standard
getfattr/setfattr/attr utils (which already have nice completions and
look more featureful)? Does it serve to abstract say Linux's xattr and
Mac's xattr systems? I'm really only using Linux, but I guess that
could be a reason to use the zsh module.

Also, does anyone know what's up with this old-but-probably-awesome
Linux Mag article by Oliver? http://www.linux-mag.com/id/2126/ I swear
I was reading it fully just last week, but now it's truncated and I
can't find an archive of it. Oliver -- do you have the original still,
ideally in a format where LM hasn't html-munged the nice ascii chars
into mdash, etc.? Oh, here's an archive that looks intact, but still
should probably be re-posted somewhere where others will find it:
http://web.archive.org/web/20070124200204/http://www.linux-mag.com/id/2126/

--

-- 
twitter:@MicahElliott  |  email:mde <at> MicahElliott.com  |  http://membean.com
Remember your words with Membean!

kolombo.inc | 10 Jan 21:18
Picon

Re: Re: Annoying zsh completion

Yeah,

I'm sorry I didn't realized that it was an case. And didn't noticed that it  
occurs only with
sudo when I was writing first email.

Thanks,
Volodya

On , Mikael Magnusson <mikachu <at> gmail.com> wrote:
> On 10 January 2012 20:41, Volodya Khomchak kolombo.inc <at> gmail.com> wrote:

> > HI,

> >

> > So I had a time and tried to do all your suggestions.

> > To answer you question - '.vim' is a folder.

> > Unfortunately I was not able to solve this using any of way you  
> proposed.

> > The only one case when it works is empty .zshrc :)

> > So I tried to set CORRECT_IGNORE='[._]*' - no results

> > HASH_LIST_ALL - no results

> >
(Continue reading)

Volodya Khomchak | 9 Jan 12:08
Picon

Annoying zsh completion

Hi all,

Approximately month ego I started to see next annoying zsh completion 
behavior.

  # vim /etc/rc.local
  # zsh: correct 'vim' to '.vim' [nyae]? n

It didn't appear with my .zshrc before and looks like this become a 
problem in latest zsh version. Currently I use `oh-my-zsh` and this 
still the issue.

  # pacman -Q zsh
  # zsh 4.3.15-2

Any help greatly appreciated.

Stephane Chazelas | 6 Jan 21:36
Picon
Favicon

Re: redirecting stdout of no/empty command

2012-01-06 20:07:35 +0100, Damien Thébault:
[...]
> (It's not affecting me much since when I need to have empty input, I
> use cat /dev/null or echo -n "")
[...]

The usual way to do it is:

: > foo

--

-- 
Stephane

Isaac Huang | 6 Jan 19:34
Picon

redirecting stdout of no/empty command

Hi list,

I noticed a zsh behaviour today. If I tried to run '>/dev/null' (i.e.
stdout redirection of no command at all) on an interactive zsh, the
zsh would actually run a 'cat', and it wouldn't exit until a ^D or ^C.

The same thing on bash seemed to be a no-op. I wonder why zsh would
run 'cat' when it was given no command to run at all.

Please CC me as I'm not on the list. Thanks.

- Isaac

Picon
Gravatar

PATH_DIRS and command completion

Hi,

just yesterday I found the PATH_DIRS option and really like the
behavior:

% ls -l /usr/bin/core_perl/cpan
-rwxr-xr-x 1 root root 5094 Dec 29 21:46 /usr/bin/core_perl/cpan*
% core_perl/cpan
zsh: no such file or directory: core_perl/cpan
% setopt PATH_DIRS
% core_perl/cpan  
cpan shell -- CPAN exploration and modules installation (v1.960001)
...

Unfortunately, tab command completion doesn't complete the folders in
$PATH.  Has anyone hacked that in already?

I.e. I want:

% cor<TAB>
core           corelist       corepkg        corrupt_mpeg2       core_perl/
% core_perl/<TAB>
c2ph*            dprofpp*    libnetcfg*   pod2html*    prove*     shasum*
config_data*     enc2xs*     perlbug*     pod2latex*   psed@      splain*
...

Cheers,
--

-- 
Christian Neukirchen  <chneukirchen <at> gmail.com>  http://chneukirchen.org

(Continue reading)


Gmane