Re: trixie and "crontab -e"
On Fri, Nov 07, 2025 at 08:37:59 -0700, D. R. Evans wrote:
> [ZB:~] export VISUAL=/usr/bin/kate
> [ZB:~] crontab -e
>
> Then I get the immediate "No modification made" message,
> [ZB:~] export VISUAL="/usr/bin/kate -n"
> [ZB:~] crontab -e
>
> then the same happens (i.e., the "-n" option makes no difference, which I
> believe is the correct behaviour: basically, it just tells the system to
> invoke a new instance even if kate is already running).
I'm not familiar with this editor. What I'm *guessing* is that
/usr/bin/kate is a "client" and it communicates with some kind of
editor server daemon, telling the daemon which file to open. Once
the daemon acknowledges the request, the client terminates.
So, what crontab sees is:
* I ran /usr/bin/kate TMPFILE.
* The /usr/bin/kate process terminated.
* The TMPFILE hasn't been changed.
* Therefore, I've removed the TMPFILE.
Meanwhile, your graphical editor window has been told to open TMPFILE,
possibly with content in it (before it was removed), possibly after
the removal, in which case you get the empty file. (This is a race
condition.)
As I said, all of the above is guesswork. You're the one who uses this
editor and would know how it works, not me.
If this is an accurate guess, then what you'll want to do is to look for
a client option that tells it to wait for the daemon to say that the
file has been closed by the editor, if any such option exists.
If no such option exists, then this editor is not suitable for this
purpose, and you'll have to choose one that can operate synchronously.
One final note: putting options into the VISUAL or EDTIOR environment
variable is questionable. Some programs will handle the options the
way you expect, and some won't. I don't know which ones of these
crontab is. If it turns out that crontab doesn't handle options the
way you expect, then write a wrapper script and use that. E.g.:
mkdir -p ~/bin
printf '#!/bin/sh\nexec kate -my --options "$@"\n' > ~/bin/katewrapper
chmod 755 ~/bin/katewrapper
export VISUAL="$HOME/bin/katewrapper"
Of course, this only matters if you can find options that make kate
act synchronously instead of asynchronously.
Reply to: