Bug 381756

Summary: kwrite sudoedit <a_file> opens 2 windows
Product: [Applications] kate Reporter: gerald.maruccia
Component: kwriteAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: kare.sars
Priority: NOR    
Version: 17.04.2   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:

Description gerald.maruccia 2017-06-28 12:11:08 UTC
Hi,

kde-neon user edition, kwrite v17.04.2

kwrite sudoedit <a_file>

opens 2 windows :
- one on <a_file>
- a second one on an empty new file

I expected only one window for <a_file>
Comment 1 Kåre Särs 2017-06-29 05:20:44 UTC
Hi,

You forgot to add "SUDO_EDITOR=" in front of kwrite.

The first part (SUDO_EDITOR=kwrite) is to set the environment variable SUDO_EDITOR to kwrite and the later part (sudoedit <a_file>) is to start the specified editor.

So you can permanently add the environment variable by adding "export SUDO_EDITOR=kwrite" to the end of your .bachrc file to not have to set it every time.

Regards,
 Kåre
Comment 2 gerald.maruccia 2017-06-29 10:41:25 UTC
Indeed… http://hpics.li/ea90c59 …my bad !

Coming from another DE I may ask silly things.

I've also noticed I actually do not need to launch kwrite as root to be able to modify a system file since kwrite asks for my password before saving. Is this intended behavior ?
Comment 3 Kåre Särs 2017-06-30 08:37:34 UTC
That asking for password before saving is a _very_ resent feature of KIO from the KF5 libraries :)
Comment 4 gerald.maruccia 2017-06-30 12:48:01 UTC
(In reply to Kåre Särs from comment #3)
> That asking for password before saving is a _very_ resent feature of KIO
> from the KF5 libraries :)

…and it's very convenient ! Thanks for your answers.