Terminal configuration improvements (patches)
-
- CodeLite Curious
- Posts: 5
- Joined: Sat Apr 07, 2012 7:41 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Terminal configuration improvements (patches)
Hi folks,
after playing around with Code::Blocks I've tried CodeLite and was impressed from the functionality of this young project. I like the work-flow, which is parallel to the one of VS (I must use this at work). But one "feature" which was annoying me, was/is the implemented terminal configuration and the hardcoded xterm-dependency for debugging with CodeLite (I feel good without xterm). So I've checked the src of CodeLite and the used functions.
You can find the results of my changes/improvements in the attachment (base was revision 5439). Sorry for the binary, but the board limits to 3 files only.
It would be good, when the changes will be merged into trunk .
after playing around with Code::Blocks I've tried CodeLite and was impressed from the functionality of this young project. I like the work-flow, which is parallel to the one of VS (I must use this at work). But one "feature" which was annoying me, was/is the implemented terminal configuration and the hardcoded xterm-dependency for debugging with CodeLite (I feel good without xterm). So I've checked the src of CodeLite and the used functions.
You can find the results of my changes/improvements in the attachment (base was revision 5439). Sorry for the binary, but the board limits to 3 files only.
It would be good, when the changes will be merged into trunk .
You do not have the required permissions to view the files attached to this post.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Terminal configuration improvements (patches)
Did you check the options under: Settings -> Global Editor Preferences -> Terminal?
You can re-configure codelite to use another terminal. I chose xterm because it is the lowest common denominator for most Linux / FreeBSD distros
Eran
You can re-configure codelite to use another terminal. I chose xterm because it is the lowest common denominator for most Linux / FreeBSD distros
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Curious
- Posts: 5
- Joined: Sat Apr 07, 2012 7:41 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Terminal configuration improvements (patches)
Ok, this question I didn't expect, but...sure I did .eranif wrote:Did you check the options under: Settings -> Global Editor Preferences -> Terminal?
Correct, but only to run the console program, which is in my opinion only a little part of an IDE. The configuration isn't considered, if you want to debug your own program (IMHO the feature of an IDE) or try to open a shell in the "explorer"-window or from the tab-bar.eranif wrote:You can re-configure codelite to use another terminal.
Where my changes really reviewed? Because they aren't only for the debugging-purpose. Was there ever a try to open a terminal different from "gnome-terminal", "konsole" and "xterm" out of the explorer or tab-bar?
Code: Select all
bool ProcUtils::Shell()
{
[...]
#else //non-windows
//try to locate the default terminal
wxString terminal;
wxString where;
if (Locate(wxT("gnome-terminal"), where)) {
terminal = where;
} else if (Locate(wxT("konsole"), where)) {
wxString path = wxGetCwd();
terminal << where << wxT(" --workdir \"") << path << wxT("\"");
} else if (Locate(wxT("xterm"), where)) {
terminal = where;
}
cmd = terminal;
#endif
return wxExecute(cmd, wxEXEC_ASYNC) != 0;
}
Code: Select all
void Manager::DbgStart ( long attachPid )
{
[...]
#if defined(__WXGTK__)
wxString where;
if ( !ExeLocator::Locate ( wxT ( "xterm" ), where ) ) { // COMMENT INSERTED FROM ME: Does a "which" on the provided string
wxMessageBox ( _( "Failed to locate 'xterm' application required by CodeLite, please install it and try again!" ), _("CodeLite" ), wxOK|wxCENTER|wxICON_WARNING, clMainFrame::Get() );
return;
}
#endif
[...]
}
Why is the function...
Code: Select all
wxString ConsoleFinder::GetConsoleName()
{
[...]
}
This could be true (at least I don't need it and haven't installed it) and I really don't want to discuss, which terminal emulator is the best, but this statement was a little bit confusing me in relation to your comment from Sat Feb 06, 2010 1:59 am "Terminal setting not used for debugger?":eranif wrote:I chose xterm because it is the lowest common denominator for most Linux / FreeBSD distros
Eran
So I was bypassing the feature request, did the change my self, post it in the main-forum and hope for a merge of it. Especially your comment was the reason, why I've done the change by my self. I want to change the situation, without to involve your time for it.eranif wrote:Unfortunately yes - I am not happy with it either
You can submit a feature request for this.
Eran
If it's not possible to merge it (why ever), then I want to stimulate a discussion about that current implementation and need of that dependency.
Now it's on you, if that change or maybe a little part of it, will be merged into trunk or at least discussed.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Terminal configuration improvements (patches)
I am don't know you enough yet to know which questions to ask.. there are newbies out there (just browse the forum) and see why I am asking this obvious questionsOk, this question I didn't expect
Maybe, I am not XFCE expert - so I will trust you on this oneBlueDarknezz wrote:I expect "terminal" from XFCE wouldn't work. Am I right?
Emphasis on "lowest"BlueDarknezz wrote:I chose xterm because it is the lowest common denominator for most Linux / FreeBSD distros
Eran
Which will probably will happen.BlueDarknezz wrote:So I was bypassing the feature request, did the change my self, post it in the main-forum and hope for a merge of it
EDIT:
Can you please submit your patch as a single file? relative to the root directory of codelite?
assuming your codelite source are under: /home/me/src/codelite/
Code: Select all
cd /home/me/src/codelite/
svn diff > mypatch.diff
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Curious
- Posts: 5
- Joined: Sat Apr 07, 2012 7:41 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Terminal configuration improvements (patches)
Absolutely no problem, everybody is at the beginning a newbie, so I know both sides .eranif wrote:I am don't know you enough yet to know which questions to ask.. there are newbies out there (just browse the forum) and see why I am asking this obvious questions
Thanks. At least CodeLite should support the big DEs (Gnome, KDE, XFCE and LXDE). But if we read out the input of the user from the configuration (we can expect mostly correct input from linux-users) and provide a fall-back-method, then we are at the safe side.eranif wrote:Maybe, I am not XFCE expert - so I will trust you on this one
Nice to read. Then I don't need to merge my self every time again .eranif wrote:Which will probably will happen.
Sure I can. Please check the attached diff and also do a cross-check of my changes, because I've merged it right now with meld back into your newest trunk.eranif wrote:EDIT:
Can you please submit your patch as a single file? relative to the root directory of codelite?
You do not have the required permissions to view the files attached to this post.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Terminal configuration improvements (patches)
Your patch cannot be applied as it is. the file "editor_config.h" which is included from CodeLite/procutils.cpp is part of the plugin_sdk project.BlueDarknezz wrote:. Please check the attached diff and also do a cross-check of my changes, because I've merged it right now with meld back into your newest trunk.
Files in the 'CodeLite' project can only includes files from the wxlibrary, standard headers or headers from the CodeLite project. Other projects may include files from the CodeLite project but not the other way around.
Attached is a simple diagram that shows the project dependency tree. Each "module" can include files from the module underneath it but not from the ones that are on top of it I fixed it by changing the method: :
Code: Select all
ProcUtils::Shell()
so it is now:
Code: Select all
ProcUtils::Shell(const wxString &programConsoleCommand)
Eran
You do not have the required permissions to view the files attached to this post.
Make sure you have read the HOW TO POST thread
-
- CodeLite Curious
- Posts: 5
- Joined: Sat Apr 07, 2012 7:41 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Terminal configuration improvements (patches)
Ah, ok. I didn't know that. Seems, that I haven't read the documentation ...sorry for that problem.eranif wrote:Your patch cannot be applied as it is. the file "editor_config.h" which is included from CodeLite/procutils.cpp is part of the plugin_sdk project.
Files in the 'CodeLite' project can only includes files from the wxlibrary, standard headers or headers from the CodeLite project. Other projects may include files from the CodeLite project but not the other way around.
I will consider that for future implementations.eranif wrote:Attached is a simple diagram that shows the project dependency tree. Each "module" can include files from the module underneath it but not from the ones that are on top of it
Yes, this was a good solution.eranif wrote:I fixed it by changing the method: :to accept the program console command as string argument.Code: Select all
ProcUtils::Shell()
so it is now:This way I removed the need for including editor_config.h in proc_utils.cppCode: Select all
ProcUtils::Shell(const wxString &programConsoleCommand)
I would prefer to implement the "find"/search functionality inside of...
Code: Select all
ConsoleFinder::GetConsoleName()
LiteEditor:
* app
* fileexplorertree
* frame
* manager
Would you approve this approach? Or is there nearly the same conflict, because ConsoleFinder is a plugin and uses the same layer?
Then there would be only 1 place which has to be maintained. This will solve the redundant code segments.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Terminal configuration improvements (patches)
Implementing it in ConsoleFinder will make it non-accessible from CodeLite.so layerBlueDarknezz wrote: because ConsoleFinder is a plugin and uses the same layer?
FYI: There were few bugs that needed a fix with the latest patch:
- "gnome-terminal" does not accept "-T" argument but only "-t" or "--title"
- There was a wrong parsing of the console name incase it was set to 'konsole'
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Curious
- Posts: 5
- Joined: Sat Apr 07, 2012 7:41 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Terminal configuration improvements (patches)
Correct, but...eranif wrote:Implementing it in ConsoleFinder will make it non-accessible from CodeLite.so layer
Code: Select all
ProcUtils::Shell()
You're right, terminal wasn't cleared and gnome-terminal uses "-t" for the title and will fail at the debug-session start of CodeLite. Sorry for the inconvenience and shame on me.eranif wrote:FYI: There were few bugs that needed a fix with the latest patch:Anyways, both of them are now fixed in trunk.
- "gnome-terminal" does not accept "-T" argument but only "-t" or "--title"
- There was a wrong parsing of the console name incase it was set to 'konsole'