Bug 417778 - Tools > Run Current Document does not actually run anything in the (integrated) terminal
Summary: Tools > Run Current Document does not actually run anything in the (integrate...
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Unclassified
Component: application (show other bugs)
Version: 19.12.2
Platform: Archlinux Packages Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-17 09:07 UTC by Marcello Massaro
Modified: 2020-10-30 13:28 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcello Massaro 2020-02-17 09:07:18 UTC
SUMMARY
If you have an open file (tested with a shell and a python script) and select Tools > Run Current document, nothing really happens.

STEPS TO REPRODUCE
1. Have a file that prints something on screen (e.g. `echo "Hello!"`)
2. Click on Tools > Run Current Document

OBSERVED RESULT
- If the integrated terminal is *not* visible, no feedback is given/nothing happens.
- If the integrated termina *is* visible, the filename gets fed to the input as if it were a command to run, which fails because it's missing `./`

EXPECTED RESULT
The file should be run, in theory according to the shebang of the file.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.18.0
KDE Frameworks Version: 5.67.0
Qt Version: 5.14.1
Kernel Version: 5.5.3-arch1-1
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-4460 CPU @ 3.20GHz
Memory: 15,3 GiB of RAM

ADDITIONAL INFORMATION
Assuming I want to run a file called "test.sh", a popup says

---
This will execute the following command,
with your user rights, in the terminal:
'test.sh
'
---

To me it's not clear which terminal it is (as stated above, without a terminal visible, nothing really happens). Also, I guess that the string '<command><LF>' is being sent to the terminal, but it looks weird to me to actually parse the LF in the GUI popup.
Comment 1 Nate Graham 2020-02-17 19:51:13 UTC
Can confirm.
Comment 2 Marcello Massaro 2020-02-19 09:11:19 UTC
I'd be happy to help/have a look, if someone can point me to the right source file. :D
Comment 3 Nate Graham 2020-02-19 14:35:10 UTC
Wonderful! Check out https://invent.kde.org/kde/kate/blob/master/addons/konsole/kateconsole.cpp
Comment 4 Justin Zobel 2020-10-27 06:06:54 UTC
(In reply to Marcello Massaro from comment #2)
> I'd be happy to help/have a look, if someone can point me to the right
> source file. :D

Hey Marcello, just wondering if you made any progress with this issue. I'm using the latest Kate and found this bug and confirm that it's still not running the program.

My simple script was:
#!/bin/bash
konsole

If the terminal panel isn't open it does nothing.
If the terminal panel is open it launches konsole.

Perhaps if the panel isn't visible kate should open it before attempting to launch the program.
Comment 5 Marcello Massaro 2020-10-30 11:19:40 UTC
(In reply to Justin Zobel from comment #4)
> (In reply to Marcello Massaro from comment #2)
> > I'd be happy to help/have a look, if someone can point me to the right
> > source file. :D
> 
> Hey Marcello, just wondering if you made any progress with this issue. I'm
> using the latest Kate and found this bug and confirm that it's still not
> running the program.
> 
> My simple script was:
> #!/bin/bash
> konsole
> 
> If the terminal panel isn't open it does nothing.
> If the terminal panel is open it launches konsole.
> 
> Perhaps if the panel isn't visible kate should open it before attempting to
> launch the program.
Hi Justin,

In principle, the fix has been approved and merged, but I don't know if it has reached a release. You can see the merged request here: https://invent.kde.org/utilities/kate/-/merge_requests/67

That's all I know.
Comment 6 Nate Graham 2020-10-30 13:28:45 UTC
Ah, looks like you forgot to add the special "BUG: 417778" keyword, so this bug report didn't get automatically closed when it was merged. Thanks for the contribution!