Bug 408907 - Open all files in a directory when executed from command line
Summary: Open all files in a directory when executed from command line
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: 19.04.2
Platform: Manjaro Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-19 13:03 UTC by Baltasar
Modified: 2021-03-12 20:38 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 21.04
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Baltasar 2019-06-19 13:03:21 UTC
SUMMARY:
You cannot open a folder from command line.


STEPS TO REPRODUCE
1. Navigate using Konsole or whatever to the foler holding the files you want to open.
2. Type "kate . &"
3. Kate complains about that the file is not a normal file, but a folder.

OBSERVED RESULT
Kate complains about that the file is not a normal file, but a folder, refusing to open anything. The terminal plugin terminal changes to that folder, though.

EXPECTED RESULT
Kate should open all files inside that folder, the ones of the recognized extensions, or maybe the ones with Mime type text.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro x86_64
KDE Plasma Version: 5
KDE Frameworks Version: 5.59.0
Qt Version: 5.12.3

ADDITIONAL INFORMATION
I can think of two options:
1. Since Kate recognizes that file as a directory, go and scan it for text files, then open them.
2. There is no "-d" option in the command line. Use it as in "kate -d . &" for opening a directory.
Comment 1 Ahmad Samir 2019-06-20 12:43:55 UTC
IMHO, it's out of kate's scope to probe the contents of a directory and open the ones it recognises as text files, whereas the user can simply use `kate dir_path/*.xyz` to open whatever files he wants or just dir_path/* to open all the files in said directory, if he knows the dir only contains text files...
Comment 2 Baltasar 2019-06-20 13:14:42 UTC
> IMHO, it's out of kate's scope to probe the contents of a directory and open the ones it recognises as text files, whereas the user can simply use `kate dir_path/*.xyz` to open whatever files he wants or just dir_path/* to open all the files in said directory, if he knows the dir only contains text files...

Well, Atom does it, as well as other recent text editors (such as Notepadqq, though this time from an explicit option in the GUI). The same argument could be applied to them.
Comment 3 Michal Hlavac 2020-08-28 13:07:58 UTC
Out of scope? This is killer feature for every good editor or IDE. VS Code, Atom, Idea, etc. all these editors support this and it really helps. Kate is good editor with fast startup, contains directory browser, so why do you think that this is out of scope?
Comment 4 Waqar Ahmed 2021-03-12 20:38:26 UTC
Fixed with https://invent.kde.org/utilities/kate/-/merge_requests/336