/jEdit/tags/jedit-4-5-pre1/org/gjt/sp/jedit/bsh/commands/getBshPrompt.bsh

# · Unknown · 24 lines · 22 code · 2 blank · 0 comment · 0 complexity · 1ee4e7c18f4ec86fa8098d68c8a84280 MD5 · raw file

  1. /**
  2. Get the value to display for the bsh interactive prompt.
  3. This command checks for the variable bsh.prompt and uses it if set.
  4. else returns "bsh % "
  5. <p/>
  6. Remember that you can override bsh commands simply by defining the method
  7. in your namespace. e.g. the following method displays the current working
  8. directory in your prompt:
  9. <p/>
  10. <pre>
  11. String getBshPrompt() {
  12. return bsh.cwd + " % ";
  13. }
  14. </pre>
  15. */
  16. String getBshPrompt()
  17. {
  18. if ( bsh != void && bsh.prompt != void )
  19. return bsh.prompt;
  20. else
  21. return "bsh % ";
  22. }