3

I am trying to create a custom JShell prompt and want to load it from a file directly.

But it is not showing the custom prompt when loading the set prompt from a file, but I am able to do it writing the same commands on JShell.

Ex: I have a file 'jshell_prompt_file' contains these 3 lines to set the prompt:

/set mode genspice -quiet
/set prompt genspice "GetNetConnectivity > " "--------> "
/set feedback genspice

When I load the file while invoking JShell, it does not change the prompt.

1:31am [login1] ~/JSHELL 1023:-)jshell jshell_prompt_file
|  Welcome to JShell -- Version 13.0.2
|  For an introduction type: /help intro

jshell> 

But when I copy-paste the same command to set feedback, then it changes it

2:53am [login1] ~/JSHELL 1034:-)jshell jshell_prompt_file
|  Welcome to JShell -- Version 13.0.2
|  For an introduction type: /help intro

jshell> /set feedback genspice

GetNetConnectivity > 

Can someone help me to achieve this without the user have to type it on command prompt? I want the first prompt to be the custom prompt.

Ortomala Lokni
  • 56,620
  • 24
  • 188
  • 240

1 Answers1

2

The feedback mode need to be set with a specific JShell command line option : --feedback.

In your file jshell_prompt_file keep only the first two lines:

/set mode genspice -quiet
/set prompt genspice "GetNetConnectivity > " "--------> "

and run JShell with:

jshell jshell_prompt_file --feedback genspice
Ortomala Lokni
  • 56,620
  • 24
  • 188
  • 240