GNOME Bugzilla – Bug 619253
Problem of ianjuta_terminal_execute_command in 2.28
Last modified: 2010-06-28 07:03:10 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
I guess you will have to ask the libvte developers here. Sorry.
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.
> 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
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 ?
Hi, Thanks a lot! I will verify the patch when I am back to office on Monday!
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