FL
how to clear clear the input line ?
echo -e '\f' > /tmp/pipe
On Fri, 21 Feb 2025, 18:22 desin24, @.***> wrote:
how to clear clear the input line ?
— Reply to this email directly, view it on GitHub https://github.com/v1cont/yad/issues/292, or unsubscribe https://github.com/notifications/unsubscribe-auth/APRODES7OWDT76SXJ7I5L4D2Q345FAVCNFSM6AAAAABXS4HQEOVHI2DSMVQWIX3LMV43ASLTON2WKOZSHA3DQNRRGQ4DQMA . You are receiving this because you are subscribed to this thread.Message ID: @.***> [image: desin24]desin24 created an issue (v1cont/yad#292) https://github.com/v1cont/yad/issues/292
how to clear clear the input line ?
— Reply to this email directly, view it on GitHub https://github.com/v1cont/yad/issues/292, or unsubscribe https://github.com/notifications/unsubscribe-auth/APRODES7OWDT76SXJ7I5L4D2Q345FAVCNFSM6AAAAABXS4HQEOVHI2DSMVQWIX3LMV43ASLTON2WKOZSHA3DQNRRGQ4DQMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
``#!/bin/bash
function BSEL
{
while : ; do
FILE="$(yad --form --separator='\n'
--field='Bash :':FL
--file-filter "*.sh .SH"
|| echo 'sf.sh'
)"
if [[ "FILE" == ".sh" ]] || [[ -f "$FILE" ]]; then
break
fi
done
printf "%s\n" "1:$FILE"
} export -f BSEL
function TSEL { while : ; do
FILE="$(yad --form --separator='\n'
--field='Text :':FL
--file-filter "*.txt *.TXT"
|| echo 'sf.txt'
)"
if [[ "$FILE" == "*.txt" ]] || [[ -f "$FILE" ]]; then break fi done printf "%s\n" "2:$FILE"
} export -f TSEL
B="Select Bash" T="Select Text" Ba="test" Te="test"
yad --form --columns=2
--separator='\n'
--center --width=60 --height=60
--field="Bash :" $Ba
--field="Text :" $Te
--field="$B":FBTN '@bash -c "BSEL %1"'
--field="$T":FBTN '@bash -c "TSEL %1"' \
Try this rendition of your code. Is this what you are looking for?
#!/bin/bash
function BSEL {
while : ; do
FILE="$(yad --form --separator='\n'
--field='Bash :':FL
--file-filter "*.sh .SH" || echo 'sf.sh' )"
if [[ "$FILE" == ".sh" ]] || [[ -f "$FILE" ]]; then
break
fi
done
printf "%s\n" "1:$FILE"
} export -f BSEL
function TSEL
{
while : ; do
FILE="$(yad --form --separator='\n'
--field='Text :':FL
--file-filter "*.txt *.TXT" || echo 'sf.txt' )"
if [[ "$FILE" == "*.txt" ]] || [[ -f "$FILE" ]]; then break fi done printf "%s\n" "2:$FILE"
} export -f TSEL
B="Select Bash" T="Select Text" Ba="test" Te="test"
yad --form --columns=2
--separator='\n'
--center --width=60 --height=60
--field="Bash :" $Ba
--field="Text :" $Te
--field="$B":FBTN '@bash -c "BSEL %1"'
--field="$T":FBTN '@bash -c "TSEL %1"'
Okay, I see in my last posting, this website stripped the trailing backslashes at the end of various lines used as continuation and readability. So, you are not seeing here what I actually posted.
Let's see if backslashing a backslash work in this posting. \
Okay. This looks better, although all indentations get stripped, the backslashes are there. Also, in the if clause in function BSEL, you had a bug I corrected here making "$FILE" == ".sh" rather than what you have "FILE" == ".sh".
Hope this helps.
#!/bin/bash
function BSEL {
while : ; do FILE="$(yad --form --separator='\n' \ --field='Bash :':FL \ --file-filter "*.sh .SH" || echo 'sf.sh' )" if [[ "$FILE" == ".sh" ]] || [[ -f "$FILE" ]]; then break fi done printf "%s\n" "1:$FILE"
} export -f BSEL
function TSEL {
while : ; do FILE="$(yad --form --separator='\n' \ --field='Text :':FL \ --file-filter "*.txt *.TXT" || echo 'sf.txt' )"
if [[ "$FILE" == "*.txt" ]] || [[ -f "$FILE" ]]; then break fi done printf "%s\n" "2:$FILE"
} export -f TSEL
B="Select Bash" T="Select Text" Ba="test" Te="test"
yad --form --columns=2 \ --separator='\n' \ --center --width=60 --height=60 \ --field="Bash :" $Ba \ --field="Text :" $Te \ --field="$B":FBTN '@bash -c "BSEL %1"' \ --field="$T":FBTN '@bash -c "TSEL %1"'