Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: vanishing spaces





On 2024-03-30 09:07, Marc Chantreux wrote:
aptitude search '~i~nnvidia' for short. check it out:

Works fine, thanks.
good:

	output="$( eval $* )"
	echo "$output"
I tried to minimalize the issue:

% var="$(aptitude search '~i~n(nvidia)')"
% print "$var"

...  but I still loose the spaces.  No variation on quoting helps.  Tried with:
emulate -L zsh
... thinking it might be some option or other, but no change.

Aside: I don't understand why you eval it. it's ok to write
In my function I have nested expansions, so the eval seemed necessary. 

Bart:

> That's not an array variable, it's a string.  You need
  output=( $( ... ) )
for array assignment.

... of course, sorry, I pasted an experimental line by accident.

> What does

print -r -- "$( eval $* )"

show?

... no improvement.  

% print -r -- "$(aptitude search '~i~n(nvidia)')"

... doesn't fix it either.

Seems Marc is using Debian (or derivative) so if he gets it showing properly then I must have some local anomaly. 

Hey ... just occurs to me now ... the aptitude columns are 'smart' -- the wider your terminal the wider the gap between columns!  So, as you intuit Bart, maybe the columnizing can't work without a terminal. -- it's a feature specific to a known width of output.

... yeah, that's it.  'aptitude --disable-columns' ... same output.  So this never was a zsh issue.  I wish we had some way of killing threads, I'd just nuke this thread as a red herring.








Messages sorted by: Reverse Date, Date, Thread, Author