I think most users will react as MikeD did, not recognizing that "sending>" is accepting input. They'll probably sit there waiting for it to finish "sending" something. Suggestion for improvement: RHQ 1.1 (blah blah) Enter agent commands at the prompt below. For a list of commands, enter $HELP_COMMAND. rhq> <MikeD> When running: [demojon@jon2client-1 bin]$ ./rhq-agent.sh -u RHQ 1.0.0.GA (Mon May 05 14:09:44 EDT 2008) sending> what is "sending>" <jweiss> MikeD: thanks for reminding me, we wanted to bring that up too <MikeD> and how long should I wait for it to return before hitting ctrl + c <ghinkle> mikeD, by not passing "start" your asking for a prompt that prompt lets you type commands <jweiss> ghinkle: qa's opinion is that "sending>" is not a prompt and MikeD's question shows that people do not recognize it as such <ghinkle> well... it is a prompt... maybe you wish it not to be? <MikeD> sounds like it is sending info to server <jshaughn> sending.... is not a prompt, it's all about the '>' ; ) <MikeD> so what is proper command? <jweiss> to me it looks like the user will expect it to finish sending <jshaughn> MikeD: help <MikeD> ./rhq-agent.sh -u start ? <ghinkle> i agree that its not super intuitive we could change the default <jweiss> i think just an angle bracket would be better <jshaughn> rhq> <jweiss> that's good too <ghinkle> sending == the state of the connector <jshaughn> there are two states/prompts <ghinkle> try the command "sender stop" <MikeD> how about bash> ;-) <jweiss> hehe <MikeD> or jon-console> you vi guy you --- jshaughn is now known as jshaughn-away <ghinkle> so. are we rolling back r1180? <ips> maybe instead of putting the connection status in the prompt, they can use "sender status" to find out the current status <jweiss> i'd be satisfied if we just print a message before the first prompt saying that it's a prompt. <MikeD> so help me out on syntax, how do I nuke the agent and start it up? ./rhq-agent.sh -u start <jweiss> but i'd prefer to change the prompt (with or without the message)
suggest we just go with a ">" prompt. When in development/debug mode, I'll try to keep this as-is (because in debug mode, its useful to know if in shutdown/started/sending mode). But for normal customer operations, we can just use ">" as the prompt.
here's the code that fixes this - will check in once svn is open again (this goes in AgentMain - its a new getDefaultPrompt() method): /** * Returns the default user prompt, which is dynamically determined based on the state of the agent and its client * command sender if the agent's logger is in debug mode. If not, a standard prompt is used no matter * what state the sender object is in. * * @return default prompt string */ private String getDefaultPrompt() { String prompt; if (LOG.isDebugEnabled()) { ClientCommandSender sender = m_clientSender; if ((sender != null) && isStarted()) { prompt = (sender.isSending()) ? PROMPT_SENDING : PROMPT_STARTED; } else { prompt = PROMPT_SHUTDOWN; } } else { prompt = PROMPT_TINY; } return prompt; } This requires a new constant defines at the top: private static final String PROMPT_TINY = "> ";
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-718