Bug 459381

Summary: KDialog odd behavior escaping exclamation mark
Product: [Applications] kdialog Reporter: Sadi <sadiyumusak>
Component: generalAssignee: Brad Hards <bradh>
Status: RESOLVED NOT A BUG    
Severity: normal CC: nate
Priority: NOR    
Version First Reported In: 22.08.1   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Sadi 2022-09-19 10:41:44 UTC
SUMMARY
***
KDialog displays escaped exclamation mark from terminal but not from a shell script.
***


STEPS TO REPRODUCE
1. Enter a terminal command like this: kdialog --title "Conversion" --passivepopup "The file has been \"converted\" now\!"
2. Copy and paste this command into an empty executable shell script file, and run the script file from the terminal.

OBSERVED RESULT
1. Terminal command results in this message text, as expected: The file has been "converted" now!
2. The script, however,  results in this message text: The file has been "converted" now\!
Additionally, the following terminal message appears:  Unrecognized escape sequence \!

EXPECTED RESULT
Escaping the exclamation mark like other characters (e.g. double quotation mark) should work in script files as well as entering it directly in terminal.  

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.25
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Comment 1 Brad Hards 2022-09-19 11:41:36 UTC
This is not a KDialog issue.

The difference in behaviour is due to using different shells. If you want to have bash behaviour in your shell script, run it in bash (not dash or whatever other shell you are using).
Comment 2 Sadi 2022-09-19 15:50:03 UTC
(In reply to Brad Hards from comment #1)
> This is not a KDialog issue.
> 
> The difference in behaviour is due to using different shells. If you want to
> have bash behaviour in your shell script, run it in bash (not dash or
> whatever other shell you are using).

I use zsh but this behavior doesn't change even if it's named *.sh and its first line is like this: #!/usr/bin/env bash
I ruled out that because KDialog --progressbar doesn't work with zsh but it works if I do as above.
BTW, is the progress bar issue also zsh issue, and not KDialog issue?
Thanks.