Hi,
I use an eclipse plugin called Mylyn [1]. Mylyn allows me to group my work into tasks (integrates with things like Bugzilla, trac etc.)[2]. The best thing that Mylyn provides is that it creates separate contexts for each of these tasks. The context influences what I see in a particular eclipse view. So for example, in the file explorer view in eclipse, I only see files that I have changed while working in this context. Additionally it also influences the auto suggest options.
The context feature works great when you have to frequenly switch between tasks. It allows you to get back into the mode for solving a particular task.
I was wondering if something similar for the shell would be useful. It could for example alter the history to only have the commands that you used in the context of working on a paritcular task. It could maybe even set up env accordingly.
Requesting your thoughts.
1. http://www.eclipse.org/mylyn/ 2. http://www.ibm.com/developerworks/java/library/j-mylyn1/
I was wondering if something similar for the shell would be useful. It could for example alter the history to only have the commands that you used in the context of working on a paritcular task. It could maybe even set up env accordingly.
I don't know if I've understood your problem but I'll hazard a guess.
I don't know if a specific plugin or a software available for bash that does this, but command completion with ^r is one way to look at your problem. Am I correct ? Would that solve your problem or you are looking for something more deeper than that, something which actually understands the context you're working in ?
On Thu, Jul 24, 2008 at 20:26, Sharninder sharninder@gmail.com wrote:
I was wondering if something similar for the shell would be useful. It
could
for example alter the history to only have the commands that you used in
the
context of working on a paritcular task. It could maybe even set up env accordingly.
I don't know if I've understood your problem but I'll hazard a guess.
I don't know if a specific plugin or a software available for bash that does this, but command completion with ^r is one way to look at your problem. Am I correct ? Would that solve your problem or you are looking for something more deeper than that, something which actually understands the context you're working in ?
Im looking for something deeper. something which maybe requires me to explicitly say: $> context server-backup
and then when i use history options such as up key, ^r also, it shows me commands which I had execute while in this context.
I guess at a starting level, all Im looking to do is associate a context id with each history entry. And then have a plugin that handles the up key to show only commands associated with the current active context id.
-- Sharninder http://nomadicrider.com/ -- http://mm.glug-bom.org/mailman/listinfo/linuxers
On Thu, Jul 24, 2008 at 8:10 PM, Puneet Lakhina puneet.lakhina@gmail.com wrote:
Hi,
I use an eclipse plugin called Mylyn [1]. Mylyn allows me to group my work into tasks (integrates with things like Bugzilla, trac etc.)[2]. The best thing that Mylyn provides is that it creates separate contexts for each of these tasks. The context influences what I see in a particular eclipse view. So for example, in the file explorer view in eclipse, I only see files that I have changed while working in this context. Additionally it also influences the auto suggest options.
In all honesty, I would find that irritating at best. If I want to open a file in my editor of choice, for example, all I do is press Ctrl-Alt-O and type a few characters of the file I'm searching for. Almost instantaneously I'm shown a list of files within the current directory that match the pattern and I just pick one (it's usually at the top) to edit. I find this to be much faster than browsing a file tree.
The context feature works great when you have to frequenly switch between tasks. It allows you to get back into the mode for solving a particular task.
I was wondering if something similar for the shell would be useful. It could for example alter the history to only have the commands that you used in the context of working on a paritcular task. It could maybe even set up env accordingly.
[snip]
How about multiplexing the terminal? Use screen for that. Each 'screen' acts as a context.
HTH.
On Fri, Jul 25, 2008 at 02:12, Yesudeep yesudeep@gmail.com wrote:
So for example, in the file explorer view in eclipse, I only see files
that
I have changed while working in this context. Additionally it also influences the auto suggest options.
In all honesty, I would find that irritating at best.
I dont understand what would you find irritating? The fact that it only shows you files that you opened in this context?Or do you find file explorers useless in general?
Well about the first thing, its always possible to turn off context view n all, its not necessary. if you find file explorers irritating in general, well then thats a personal choice.
If I want to open a
file in my editor of choice, for example, all I do is press Ctrl-Alt-O and type a few characters of the file I'm searching for.
This is possible in eclipse too.. using Ctrl+Shift+r. and then the file that you open gets added to your context. and even in the suggest box of this shortcut the selected files show up higher next time when you use it.
Almost instantaneously I'm shown a list of files within the
current directory
only in current directory? well thats a bit limiting.
that match the pattern and I just pick one (it's usually at the top) to edit. I find this to be much faster than browsing a file tree.
How about multiplexing the terminal? Use screen for that. Each 'screen' acts as a context.
This looks interesting, will try it out, thanks :-)
On Thu, Jul 24, 2008 at 7:40 AM, Puneet Lakhina puneet.lakhina@gmail.com wrote:
I was wondering if something similar for the shell would be useful. It could for example alter the history to only have the commands that you used in the context of working on a paritcular task. It could maybe even set up env accordingly.
I don't know how much this satisfies your requirements, but I do something on the following lines (And given your exposure to mylyn, you can think of expanding this further - my requirements, and hence the solution, are simple):
I create various "contexts" and set my env-variables to specific values for a given context. Let's say, I have contexts A and B to work in, and I have corresponding directories A and B in my $HOME. Then I define functions in my shell which set up some variables based on the context I am requesting ($HOME, $PATH, $CVSROOT, $HISTFILE, $PS1 etc.) - and have a 'revert' function (I call 'b2n' - back-2-normal) which resets all variables to the original ones).
Nothing sophisticated, but works for me!
(The following goes into your shell's config file) <script-snippet> if [ -z "$OLDHOME" ]; then export OLDHOME=$HOME fi if [ -z "$OLDPATH" ]; then export OLDPATH=$PATH fi if [ -z "$OLDLD_LIBRARY_PATH" ]; then export OLDLD_LIBRARY_PATH=$LD_LIBRARY_PATH fi if [ -z "$OLDCVSROOT" ]; then export OLDCVSROOT=$CVSROOT fi if [ -z "$OLDPS1" ]; then export OLDPS1=$PS1 fi if [ -z "$OLDPKG_CONFIG_PATH" ]; then export OLDPKG_CONFIG_PATH=$PKG_CONFIG_PATH fi if [ -z "$OLDCLASSPATH" ]; then export OLDCLASSPATH=$CLASSPATH fi
b2n () { export HOME=$OLDHOME export PATH=$OLDPATH export LD_LIBRARY_PATH=$OLDLD_LIBRARY_PATH export CVSROOT=$OLDCVSROOT export PS1=$OLDPS1 export PKG_CONFIG_PATH=$OLDPKG_CONFIG_PATH export CLASSPATH=$OLDCLASSPATH cd }
contextA() { export HOME=$OLDHOME/A .... cd } </script-snippet>
HTH.