After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 619253 - Problem of ianjuta_terminal_execute_command in 2.28
Problem of ianjuta_terminal_execute_command in 2.28
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: plugins: terminal
unspecified
Other Linux
: Normal major
: ---
Assigned To: Naba Kumar
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2010-05-21 02:47 UTC by liping Ke
Modified: 2010-06-28 07:03 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description liping Ke 2010-05-21 02:47:32 UTC
Hi, all
When I am fixing poky plugin bugs, we found when start local GDB, it will call 
ianjuta_terminal_execute_command. If the gdb is not found, the terminal will enter "un-response" state, not responds to any user input/output. For testing this,
I add a second valid command, ianjuta_terminal_execute_command(..."pwd"...) after this failure execution command. The terminal will be brought back. Interesting thing is that even if I directly execute ianjuta_terminal_execute_command(..."pwd"...) or ianjuta_terminal_execute_command(..."ps"...), I did not see the terminal output (did not list the current path information or process infos) at all.

After checking the code, I found it depends on vte terminal implementation. And different version varies greatly and very complex. Since I am using anjuta2.28 on Ubuntu Karmic9.10, I am not sure whether latest version still have the problem.

Could you help to give any hint? I originally thought this vte_terminal_fork_command should direct all "cmd" input/output to this vte terminal, just as user input a command into the terminal and wait for a reply?

Thanks a lot for your help!
criping
Comment 1 Johannes Schmid 2010-06-07 21:01:22 UTC
I guess you will have to ask the libvte developers here. Sorry.
Comment 2 liping Ke 2010-06-25 05:24:02 UTC
I filed this bug to vte:
https://bugzilla.gnome.org/show_bug.cgi?id=622478

And seems vte has nothing to do, but to do something in plugin/terminal/terminal.c in anjuta. 
1) we need to judge whether the child_id == -1, execution fails before vte_reaper_add_child.
2) if fails, we need to restart a new shell, otherwise, the console will be responsive. It's plugin's job according to vte's site input.
Comment 3 liping Ke 2010-06-25 05:36:04 UTC
> 2) if fails, we need to restart a new shell, otherwise, the console will be
> responsive. It's plugin's job according to vte's site input.

Maybe just terminal_execute (pwd) or terminal_execute('\n'), this workaround could bring console back.
I found in eclipse rse terminal/shell plugin, this "pwd" workaround (we prefer '\n') is widely used. This problem should be the terminal console plugin common issues.

Thanks& Regards,
criping
Comment 4 Sébastien Granjoux 2010-06-25 10:16:56 UTC
I think the issue was because Anjuta launch 2 terminals. On with a shell to allow the user to enter some commands and another one for the programs that are executed. So when you call ianjuta_terminal_execute, the terminal with the shell is hidden and Anjuta display the terminal for the command you are executing. The terminal with the shell is restored when the command end. In your case the command end callback is never called so you don't get back the terminal with the shell.

I think I have fixed this bug in master branch with this patch	4a0ce8043f31bff75ec344a5927f512e0bac595d. As I cannot reproduce exactly the bug here, could you check yourself (It shouldn't be a problem to apply this patch on Anjuta 2.28) and tell me if it fixes your issue ?
Comment 5 liping Ke 2010-06-26 13:06:30 UTC
Hi, Thanks a lot! I will verify the patch when I am back to office on Monday!
Comment 6 liping Ke 2010-06-28 02:57:21 UTC
Hi, I have verified the bug by patching it on 2.30.2.0. The default terminal is switched back as you said. It's fine. Thanks a lot for solving the problem. 


Thanks& Regards,
criping