This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 152168 - Cannot run c program in KDE konsole
Summary: Cannot run c program in KDE konsole
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All Linux
: P3 blocker (vote)
Assignee: Andrew Krasny
URL:
Keywords:
: 158466 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-11-03 08:57 UTC by lvs
Modified: 2009-04-24 07:41 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lvs 2008-11-03 08:57:35 UTC
Building hello_world C program is successful, but cant run it from ide:
Running "/usr/bin/konsole -e "/ext/netbeans-6.5rc2/cnd2/bin/dorun.sh" -p "[Press Enter to close window]" -f "/tmp/
nbcnd_rc4559" dist/Debug/GNU-Linux-x86/hello_world " in /home/lvs/NetBeansProjects/hello_world

Run failed. Exit value 127.

/ext/netbeans-6.5rc2/cnd2/bin/dorun.sh: 105: ./dist/Debug/GNU-Linux-x86/hello_world: not found
[Press Enter to close window]

I've changed dorun.sh so it prints pwd result, and it is /home/lvs instead of /home/lvs/NetBeansProjects/hello_world

And I can run program directly.

Distro: Fresh Kubuntu 8.10.
Comment 1 Peter Pis 2008-11-03 09:16:18 UTC
Reassigning to cnd.
Comment 2 Leonid Lenyashin 2008-11-03 11:26:12 UTC
This sounds like an project version upgrade issue. Did you have this project created with some earlier version of NB?
Could you please check if the following workaround helps: go to Project properties, change anything, press "Apply" (then
you can restore the changed value), this will cause project configuration to regenerate, then try to build and run again.
Comment 3 lvs 2008-11-03 12:53:33 UTC
Oh, there is project properties! Haven't seen before.
No, I am new to netbeans, this project is generated by that netbeans version.
Changing values in project properties doesn't helps.
But if I change proj.prop->run->console type->output window, program runs ok.
And it also runs by Debug Project (in konsole).

Only Run Project in external console doesn't works.

And when I opened Project Properties->Run, there was no path visible in Run Directory, but it apears in "..." dialog, 
and after pressing OK, it becomes visible in Run Dirictory. (I don't know, maybe it is supposed to be so). That doesn't 
helps too.
And changing Always Relative in Tools->Options->Project Options to Always Absolute also doesn't helps.
Comment 4 Sergey Grinev 2008-11-28 16:31:13 UTC
Which version of Netbeans are you using? NB6.5 have been just released, can you try it, please.

I see links to "netbeans-6.5rc2" in your log where we had some issues with running terminal window, which were fixed in
release. It looks like either old NetBeans, or invalid installation.
Comment 5 _ gordonp 2008-12-01 17:49:05 UTC
> Running "/usr/bin/konsole -e "/ext/netbeans-6.5rc2/cnd2/bin/dorun.sh" -p "[Press Enter to close window]" \
> -f "/tmp/nbcnd_rc4559" dist/Debug/GNU-Linux-x86/hello_world " in /home/lvs/NetBeansProjects/hello_world

Someone reported this problem on one of our email forums several weeks ago. It looks like the problem is
that konsole runs from you're home directory by default and our setup assumes the project directory (this
may be a konsole change in a recent release of KDE). In any case, I made some untested changes in the
options we use in starting konsole about 3 weeks ago (untested because I don't have access to any KDE
systems).

Can you try downloading a nightly dev build from http://bits.netbeans.org/dev/nightly/latest and see
if this fixes the konsole problems?

You could also try switching from konsole to xterm or gnome-terminal. Both of those terminals are much
more actively tested than konsole.
Comment 6 lvs 2008-12-02 03:29:59 UTC
I've tested my 6.5b version with installed xterm - works.
Tested latest night build - with konsole (KDE4) still doesn't work.
The error is:
konsole: Unknown option 'menubar'.
konsole: Use --help to get a list of available command line options.
RUN FAILED (exit value 254, total time: 559ms)

And I installed xfce4-terminal, but I cannot select it as external terminal in project properties. It's really good 
terminal - it's much faster then konsole, more powerful and it's not from gnome. However xterm is faster, but lacks 
some features (like native UTF8). 
Hope there will be support for it.
Comment 7 Thomas Preisler 2009-02-12 23:24:48 UTC
Looks like some konsole implementations have problems with the --nomenubar option. Will try and remove it and see if it help. This option is not critical.

I wil mark this issue fixed. Please reopen with exact error messages if it does not work.

Also, please file separate issue (enhancement) regarding xfce4-terminal.
Comment 8 Thomas Preisler 2009-02-13 00:05:52 UTC
*** Issue 158466 has been marked as a duplicate of this issue. ***
Comment 9 Quality Engineering 2009-02-18 10:30:17 UTC
Integrated into 'main-golden', will be available in build *200902180201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/edf76fc148c9
User: Thomas Preisler <thp@netbeans.org>
Log: #152168 Cannot run c program in KDE konsole
Comment 10 rclokie 2009-04-05 04:53:59 UTC
Reopening as requested --nomenubar has been removed sucessfully, but output from konsole now is:

konsole: Unknown option 'tabbar'.
konsole: Use --help to get a list of available command line options.

So it doesn't like --notabbar either. 

For the record:
rclokie@batcave:~/netbeans-dev-200904030200$ konsole --version
Qt: 4.4.3
KDE: 4.2.2 (KDE 4.2.2)
Konsole: 2.2.2

konsole --help gives

Options:
  --profile <file>          Name of profile to use for new Konsole instance
  --list-profiles           List the available profiles
  --background-mode         Start Konsole in the background and bring to the front when the F12 key is pressed
  --new-tab                 Create a new tab in an existing window rather than creating a new window
  --workdir <dir>           Set the initial working directory of the new tab or window to 'dir'
  --notransparency          Disable transparent backgrounds, even if the system supports them.
  --force-transparency      Try to enable transparency, even if the system does not appear to support it.
  --hold, --noclose         Do not close the initial session automatically when it ends.
  -p <property=value>       Change the value of a profile property.
  -e <cmd>                  Command to execute

Comment 11 Thomas Preisler 2009-04-06 23:16:44 UTC
There are several things wrong:

1) --notabbar option should be remove. It is apparently no longer supported by Ubuntu konsole.
2) It doesn't help just removing this option from terminal description in kde-konsole.xml. It then fails in another way:
Unknown option 'T ....'
3) Where is --workdir option? It should still be set!
4) Workdir option seems not set for other terminal types either. This is wrong.

Handing it over to Gizmo guys for evaluation.
Comment 12 rclokie 2009-04-06 23:25:46 UTC
I'm obviously very new to netbeans source, but I'm not sure what you're referring to with 'kde-konsole.xml'.
In the changeset http://hg.netbeans.org/main/rev/edf76fc148c9 I can see the --workdir option still being set, along with
the --notabbar - so from first glance it isn't looking at a kde-konsole.xml file at all. Please correct me if I'm on the
wrong track :)

If you don't have access to a KDE system I can try and get it compiling later today, and see if I can fix it myself,
otherwise I'm more than willing to test your builds. 
Comment 13 Thomas Preisler 2009-04-07 00:52:32 UTC
I do have access to Ubuntu/KDE and can reproduce your bug. Our implementation of support for external terminals has changed quite a bit since my last commit. Terminals are now described in xml code like 
the kde-konsole is described in dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/resources/terminalsupport/kde-konsole.xml:
<terminaldefinition xmlns="http://www.netbeans.org/ns/nativeexecution-terminal-definition/1">
    <terminal id="konsole" platforms="solaris,linux"/>
    <searchpaths>
        <path>/usr/bin</path>
        <path>/bin</path>
        <path>/opt/kde/bin</path>
        <path>/opt/kde3/bin</path>
        <path>/opt/kde4/bin</path>
        <path>/usr/openwin/bin</path>
        <path>/usr/X/bin</path>
        <path>/usr/X11/bin</path>
        <path>/usr/X11R6/bin</path>
    </searchpaths>
    <command stringvalue="konsole"/>
    <arguments>
        <arg>--notabbar</arg>
        <arg>-T $title</arg>
        <arg>-e</arg>
        <arg>$@</arg>
    </arguments>
</terminaldefinition>

--notabbar needs to be removed but that is not enough. There is something else wrong. And the workdir option is missing. I'm waiting for Andrew's evaluation.

Comment 14 Leonid Lenyashin 2009-04-10 09:39:41 UTC
Here is always a workaround to use Output window, so downgrading to P3.
Comment 15 Andrew Krasny 2009-04-15 15:03:54 UTC
Fixed with: http://hg.netbeans.org/cnd-main/rev/e4c6d35833d8
Comment 16 Quality Engineering 2009-04-24 07:41:22 UTC
Integrated into 'main-golden', will be available in build *200904240201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a1855e565617
User: Thomas Preisler <thp@netbeans.org>
Log: #152168 Cannot run c program in KDE konsole