Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Custom prompt(Changing the default Equinox console prompt)
Custom prompt [message #1696087] Thu, 21 May 2015 15:39 Go to next message
Emilio Nunez is currently offline Emilio NunezFriend
Messages: 2
Registered: May 2015
Junior Member
Hi. I'd like to know if it's possible to customize the command prompt in the Equinox command console (change 'osgi>' with a different text).

We are using Equinox 3.9.1 (Kepler) as a standalone OSGi container.

Thanks a lot.

Best regards,
Emilio
Re: Custom prompt [message #1696332 is a reply to message #1696087] Mon, 25 May 2015 18:38 Go to previous messageGo to next message
Emilio Nunez is currently offline Emilio NunezFriend
Messages: 2
Registered: May 2015
Junior Member
Hi again.

After a bit of research I've got it. In case anyone is interested, this is how I've fixed it:

1) Define a system variable 'gosh.home' set to any directory you want (e.g. /projects/foo)

2) Inside this directory it's needed to create another directory called 'etc' which contains a file named 'gosh_profile':

/projects/foo/
/etc/
gosh_profile

This file has a defined format. It's easy to find examples searching in the net (you can also find it into the plugin 'org.apache.felix.gogo.shell_xxxxxx.jar') . According to the comment at the beginning of the file:

# only read if etc/gosh_profile doesn't exist relative to the System property
# gosh.home or failing that the current directory.

One of the parameters defined states the console prompt:

prompt = 'osgi> '

All I had to do is set this parameter to the desired value. After restating Equinox changes took effect.

Hope this helps.

Greetings!
Re: Custom prompt [message #1872533 is a reply to message #1696332] Wed, 06 November 2024 09:55 Go to previous message
Marco Descher is currently offline Marco DescherFriend
Messages: 198
Registered: October 2010
Location: Austria
Senior Member
This implementation uses a function to provide a fully dynamic prompt:

* Override gosh_profile see https://github.com/elexis/elexis-server/tree/master/bundles/es.gogo.shell
* Implementation of the reference prompt function see https://github.com/elexis/elexis-3-core/blob/master/bundles/ch.elexis.core/src/ch/elexis/core/console/internal/Prompt.java

This prompt will hold for both the local console provided via -console and the telnet console provided via -console PORTNO

[Updated on: Wed, 06 November 2024 09:55]

Report message to a moderator

Previous Topic:Inquiry About Support for Java 21
Goto Forum:
  


Current Time: Fri Jan 17 12:51:58 GMT 2025

Powered by FUDForum. Page generated in 0.03461 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top