0

I'm trying to incorporate YAD into my script to add a more GUI feel to it. (It may end up being written in Python at a later date.) I'm able to use similar code to produce a listbox with selectable items in an earlier part of the code without issue, but this bit is doing my head in.

x=1
for f in "${Basic_Info[@]}" ; do echo " $x $f" ; x=$(( x + 1 )) ; done 

album=$(for f in "${Basic_Info[@]}" ; do echo FALSE ; echo "$f" ; done | yad --list \
    --center --title="Album selection" --height="$hite" --width="550" --checklist \
     --column="Select" --column="Artist - Album to use:" --print-column="2" )

The above produces the following:- Screen output from the echo loop Screen output from echo command

and: The YAD listbox output

enter image description here

If you cannot see the attached pictures, the problem is:-

The for loop using echo produces the correct output on the screen.

The for loop piped to the YAD list shows incorrect output.

Obviously the variable $hite changes depending upon the number of items in the Basic_Info array, but doesn't affect the incorrect output.

Please can somebody tell me what is going on, as I'm starting to lose my mind over this issue.

Many thanks in advance.

John_S
  • 53
  • 2
  • 8

1 Answers1

0

you have & character in song's names. add --no-markup option to yad or filter loop output through sed "s/&/&/g"

  • Hi VictorAnanjevsky - welcome to Stack Overflow. Your answer is almost there - please add a little more clarification about the problem .. e.g. something like - by default YAD treats the content as markup, so characters like & need to be quoted to be valid markup, OR yad should be run with the --no-markup option. And you can make a small code snippet (use _```_ on a line at the start, and on a line after it) showing how to fix (because it isn't just & that needs to be considered is it??) – Mr R Apr 02 '21 at 11:34