Bug 536360 (RHQ-718) - Agent 'sending>' prompt is misleading - change prompt
Summary: Agent 'sending>' prompt is misleading - change prompt
Keywords:
Status: CLOSED NEXTRELEASE
Alias: RHQ-718
Product: RHQ Project
Classification: Other
Component: Agent
Version: 1.0.1
Hardware: All
OS: All
low
medium
Target Milestone: ---
: ---
Assignee: John Mazzitelli
QA Contact:
URL: http://jira.rhq-project.org/browse/RH...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-08-06 21:43 UTC by Jeff Weiss
Modified: 2014-11-09 22:50 UTC (History)
1 user (show)

Fixed In Version: 1.2
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
all
Last Closed:
Embargoed:
jweiss: archived+


Attachments (Terms of Use)

Description Jeff Weiss 2008-08-06 21:43:00 UTC
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)

Comment 1 John Mazzitelli 2008-10-07 15:11:46 UTC
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.

Comment 2 John Mazzitelli 2008-10-10 20:21:46 UTC
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 = "> ";


Comment 3 Red Hat Bugzilla 2009-11-10 21:15:27 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-718



Note You need to log in before you can comment on or make changes to this bug.