https://bugs.kde.org/show_bug.cgi?id=369525

            Bug ID: 369525
           Summary: Rewrite the command echo in the Build toolview
           Product: kdevelop
           Version: git master
          Platform: Other
                OS: All
            Status: UNCONFIRMED
          Severity: critical
          Priority: NOR
         Component: Build tools: CMake
          Assignee: kdevelop-bugs-n...@kde.org
          Reporter: rjvber...@gmail.com

Here's an example command echo from the build toolview/progress window:

/Users/bertin/work/src/MSWin/SynchroTr/CMake/Release> /opt/local/bin/cmake
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=MacPorts -G 'Unix
Makefiles' -Wno-dev '-DCMAKE_C_FLAGS=-O3 -march=native -g'
'-DCMAKE_CXX_FLAGS=-O3 -march=native -g'

Guess what happens when you are trying to figure out why things don't configure
as you expect, you copy the line using the "Copy selection to clipboard"
toolbutton, and paste the result in a terminal, for instance with the idea of
appending "--debug-output"

Reproducible: Always

Steps to Reproduce:
1. Copy a progress command echo like the one shown above
2. Paste into a terminal


Actual Results:  
The line will be executed because a newline was included during the copy
procedure. There's little one can do about that, except for remembering to type
a comment or illegal character (I often use a brace) before doing the paste.

If the file after the '>' is owned by the user, its contents will be lost.

Expected Results:  
This is of course the expected result...

The problem could be avoided by printing what is actually being done:

(cd /Users/bertin/work/src/MSWin/SynchroTr/CMake/Release ; /opt/local/bin/cmake
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=MacPorts -G 'Unix
Makefiles' -Wno-dev '-DCMAKE_C_FLAGS=-O3 -march=native -g'
'-DCMAKE_CXX_FLAGS=-O3 -march=native -g')

or by using a different "prompt" character that doesn't have a special meaning
in the shell.

Alternatively, the build progress view (and similar toolviews) could support
partial selection instead of allowing to select only complete lines.

You could call this a stupid operator error and that wouldn't be entirely
wrong. I would evidently never have executed the command "as is", and if I
hadn't been trying to figure out why something didn't work I might even have
double-checked what I was about to do before pasting.
Still, it's something that clearly can happen, with potentially very annoying
results.

I experienced dataloss because of this, so I'm putting a Critical severity.
Feel free to bump it down after having taken note ;)

I'm volunteering to look into this and put up a draft modification for review;
just please point me to the code that has to be changed. Searching for a '>' in
a large C++ project might provoke a hay fever attack otherwise ;)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to