Clear konsole command-line before send cd command
ClosedPublic

Authored by loh.tar on May 2 2019, 9:06 PM.

Details

Summary

When changing tabs anything that exists in the command line gets executed
which can be very dangerous.

Test Plan

Pls see D9590

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
loh.tar created this revision.May 2 2019, 9:06 PM
Restricted Application added a project: Kate. · View Herald TranscriptMay 2 2019, 9:06 PM
Restricted Application added a subscriber: kwrite-devel. · View Herald Transcript
loh.tar requested review of this revision.May 2 2019, 9:06 PM
ngraham added a subscriber: ngraham.May 2 2019, 9:46 PM

Does that obsolete the other patch and is this ok for any posix shell?

Does that obsolete the other patch

That was my hope

and is this ok for any posix shell?

My source was this general looking question. But reading there indicate that they all refer to Bash :-/
https://stackoverflow.com/questions/9679776/how-do-i-clear-delete-the-current-line-in-terminal

OTH is there https://www.unix.com/man-page/All/1posix/sh some vi mode described.

kill Clear all the characters from the input line.

Whatever that means. "less" at least works here similar. No Guru around? :-)
And, isn't Kate also running on Windows? What's then?

sars added a subscriber: sars.May 3 2019, 7:16 AM

This is not an issue on Windows (yet?) as the whole konsole plugin is disabled on Windows.

Ctrl-U is "Cut everything before the cursor", so if you have moved the cursor to the beginning of the line nothing is removed...

So we would need to send Ctrl-E before Ctrl-U.

I tried these with sh and I could remove the line with Ctrl-U.

I think there is always going to be some corner case where this will not work, but better than nothing?....

loh.tar updated this revision to Diff 57640.May 6 2019, 1:29 PM
loh.tar retitled this revision from Clear konsole command-line before send any new command to Clear konsole command-line before send cd command.
  • Move code to cd function
  • Add Ctrl-E as suggested
cullmann accepted this revision.May 6 2019, 6:06 PM

Think this is ok then. For Windows: that plugin doesn't work there anyways.

This revision is now accepted and ready to land.May 6 2019, 6:06 PM
This revision was automatically updated to reflect the committed changes.