Bug 473248 - malfunction with BASH's default edit-and-execute-command ability (CTRL+X+E)
Summary: malfunction with BASH's default edit-and-execute-command ability (CTRL+X+E)
Status: RESOLVED NOT A BUG
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 23.07.80
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-10 15:35 UTC by witchhunter
Modified: 2023-08-13 16:54 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description witchhunter 2023-08-10 15:35:06 UTC
SUMMARY

Hi,
BASH's shortcut CTRL+X+E evoke build-in functionality "edit-and-execute-command", to open a text editor and easily edit the current terminal input line.
It will open text editor firstly defined by a BASH's VISUAL variable. If VISUAL is set to Kate, the window does open, with the title of the temporary file /tmp/bash-fc.******, but the window do not contain terminal's current input line. It is empty instead and the command in terminal is executed **immediately** instead.
Next, I disabled all plugins in Kate and try again, but the same thing happens.
If VISUAL is set to KWrite, everything works just fine.


Next I tried to monitor the /tmp folder for changes and the following output emerge:

$ gio monitor /tmp
/tmp: /tmp/bash-fc.ucBQgP: created
/tmp: /tmp/bash-fc.ucBQgP: changed
/tmp: /tmp/bash-fc.ucBQgP: changes done
/tmp: /tmp/bash-fc.ucBQgP: deleted
/tmp: /tmp/qipc_systemsem_zVDdHIsprmyBOBYIzCaFmgFtFEXTDoqwkIes5944f7e34559639eb7e08b12675dbc30b4a2bc4e: created
/tmp: /tmp/qipc_systemsem_zVDdHIsprmyBOBYIzCaFmgFtFEXTDoqwkIes5944f7e34559639eb7e08b12675dbc30b4a2bc4e: changes done
/tmp: /tmp/qipc_systemsem_zVDdHIsprmyBOBYIzCaFmgFtFEXTDoqwkIes5944f7e34559639eb7e08b12675dbc30b4a2bc4e: deleted
/tmp: /tmp/qipc_systemsem_zVDdHIsprmyBOBYIzCaFmgFtFEXTDoqwkIes5944f7e34559639eb7e08b12675dbc30b4a2bc4e: created
/tmp: /tmp/qipc_systemsem_zVDdHIsprmyBOBYIzCaFmgFtFEXTDoqwkIes5944f7e34559639eb7e08b12675dbc30b4a2bc4e: changes done
/tmp: /tmp/qipc_sharedmemory_zVDdHIsprmyBOBYIzCaFmgFtFEXTDoqwkIes5944f7e34559639eb7e08b12675dbc30b4a2bc4e: created
/tmp: /tmp/qipc_sharedmemory_zVDdHIsprmyBOBYIzCaFmgFtFEXTDoqwkIes5944f7e34559639eb7e08b12675dbc30b4a2bc4e: changes done
/tmp: /tmp/.sJEZWJ: created
/tmp: /tmp/.sJEZWJ: changes done
/tmp: /tmp/.sJEZWJ: attributes changed
/tmp: /tmp/zV24DdHIsp+rmyBO7B2YIzCaFm6g_FtFEXTDoqwkIes=: moved in
/tmp: /tmp/.sJEZWJ: deleted


And when the Kate's window is closed, the command continues:

/tmp: /tmp/zV24DdHIsp+rmyBO7B2YIzCaFm6g_FtFEXTDoqwkIes=: deleted
/tmp: /tmp/qipc_sharedmemory_zVDdHIsprmyBOBYIzCaFmgFtFEXTDoqwkIes5944f7e34559639eb7e08b12675dbc30b4a2bc4e: deleted
/tmp: /tmp/qipc_systemsem_zVDdHIsprmyBOBYIzCaFmgFtFEXTDoqwkIes5944f7e34559639eb7e08b12675dbc30b4a2bc4e: deleted


STEPS TO REPRODUCE
1.  set Kate as VISUAL editor
2.  Type some command in Konsole
3.  Press CTRL+X+E to open Kate and edit the command

OBSERVED RESULT
The command in terminal is executed immediately.
Kate window will open but empty.

EXPECTED RESULT
The command in terminal  should show up in Kate. 
The command in terminal should wait for editing and saving in Kate.  

SOFTWARE/OS VERSIONS
Operating System: KDE neon Testing Edition
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.109.0
Qt Version: 5.15.10
Kernel Version: 6.2.0-26-generic (64-bit)
Graphics Platform: X11
Comment 1 Christoph Cullmann 2023-08-13 16:54:35 UTC
I think you need to set it to 'kate -b', else the call will not block.