Rocket U2 | UniVerse & UniData

 View Only
Expand all | Collapse all

Modify the system prompt '>'?

  • 1.  Modify the system prompt '>'?

    Posted 09-05-2023 13:35

    Working with a group of developers, I'd like to modify the system prompt in UniVerse from the standard '>' to include the account in which they are working. The 'WHO' command can give misleading results as it shows the folder in which they are running which may or may not be the UniVerse account. For instance, my developers each have a folder that contains the various accounts that they need for testing and source control. An example might be '/bl1/DEV_ABC/COM' and the 'WHO' command returns 'COM' but the UV.ACCOUNT record for this path is 'COM_ABC'. So, I'd like to modify the system prompt to show 'COM_ABC>'. I would assume that this could be set either in the 'LOGIN' script or in 'UV.LOGIN'. That will provide a visual cue that they are not in a production account. So far, searching the documentation has not produced an answer.

    TIA!



    ------------------------------
    Jeff Teter
    Woodforest National Bank
    The Woodlands, TX
    ------------------------------


  • 2.  RE: Modify the system prompt '>'?

    Posted 09-05-2023 14:30

    Have you tried writing your own CLI?  I call mine XTCL.  The prompt is customizable.  For example, I made mine so an active-list inverts and flashes the prompt rather than just doubling it (>>).  I can send you the code, if you like.



    ------------------------------
    Marcus Rhodes
    marcus1@thinqware.com
    ------------------------------



  • 3.  RE: Modify the system prompt '>'?

    Posted 09-05-2023 14:50

    Thanks for the quick reply. That's an interesting idea and I'd be interest in seeing how you implemented. Seems like the database would allow some customization, similar to Linux, Windows, etc.



    ------------------------------
    Jeff Teter
    Woodforest National Bank
    The Woodlands, TX
    ------------------------------



  • 4.  RE: Modify the system prompt '>'?

    Posted 09-06-2023 09:50

    Sorry.  Busy at work.  They're attached.  Just remove the .txt extension that I had to add in order to upload them here, and comment-out or delete non-UV code segments.  (They're clearly marked.)

    XTCL is the CLI clone (but better).

    EMV_INP_FLD is the actual input line.

    ANY_KEY... is the key input that can take any key/combination you press.

    Be sure to read the extensive comments.-



    ------------------------------
    Marcus Rhodes
    marcus1@thinqware.com
    ------------------------------

    Attachment(s)

    txt
    ANY_KEY_TBL.txt   179 KB 1 version
    txt
    ANY_KEY_RPT.txt   3 KB 1 version
    txt
    ANY_KEY_TST.txt   19 KB 1 version
    txt
    XTCL.txt   13 KB 1 version
    txt
    ANY_KEY_TRM.txt   38 KB 1 version
    txt
    ANY_KEY.txt   21 KB 1 version
    txt
    ANY_KEY_CFG.txt   49 KB 1 version
    txt
    ANY_KEY_EQU.txt   24 KB 1 version
    txt
    ANY_KEY_ATW.txt   36 KB 1 version
    txt
    ANY_KEY_INI.txt   966 B 1 version
    txt
    EMV_INP_FLD.txt   17 KB 1 version
    txt
    ANY_KEY_BLD.txt   18 KB 1 version


  • 5.  RE: Modify the system prompt '>'?

    ROCKETEER
    Posted 09-05-2023 15:03

    Hi Jeff,

    To my knowledge, the only thing directly available in UniVerse is the UVPROMPT command. This allows you to change the prompt character from the default ">". But you can only change a single character. There is no capability to change it to a string. So doing something las suggested by Marcus may be the best solution.

    Thanks,

    Neil



    ------------------------------
    Neil Morris
    Universe Advanced Technical Support
    Rocket Software
    ------------------------------



  • 6.  RE: Modify the system prompt '>'?

    Posted 09-06-2023 02:46

    You can use the undocumented  ASSIGN and SYSTEM 4001 & 4002 

    4001 - 4002 Assign a string to TCL prompt, instead of single character:
            STELPROMPT = @WHO : '>' ; * normal
            STELPROMPT<2> = @WHO : '>>' ; select list active
            STELPROMPT<3> = '+' ; multi-line command
            ASSIGN 1 TO SYSTEM(4001)
            ASSIGN STELPROMPT TO SYSTEM(4002) 

    We actually use

    ASSIGN 1 TO SYSTEM(4001)
    ASSIGN @(-13):@WHO:@(-14):' >':@FM:@(-13):@WHO:@(-14):' >>':@FM:'+' TO SYSTEM(4002)



    ------------------------------
    Andy Baum
    Senior Solutions Developer
    DPD Group UK
    Smethwick GB
    ------------------------------



  • 7.  RE: Modify the system prompt '>'?

    PARTNER
    Posted 09-06-2023 20:57

    I created this from @Andy Baum's snippet.

    * Setting the TCL prompt
    *
    * Author:  Gregor Scott
    * Date  :  07-09-2023
    *
    * Derived from a post in the Rocket Forum by Andy Baum, responding to the
    * thread "Re: Modify the system prompt '>'? " on 06-Aug-2023:
    *__________________________________________________________________________
    * You can use the undocumented  ASSIGN and SYSTEM 4001 & 4002 
    * 4001 - 4002 Assign a string to TCL prompt, instead of single character:
    *         STELPROMPT = @WHO : '>' ; * normal
    *         STELPROMPT<2> = @WHO : '>>' ; select list active
    *         STELPROMPT<3> = '+' ; multi-line command
    *         ASSIGN 1 TO SYSTEM(4001)
    *         ASSIGN STELPROMPT TO SYSTEM(4002) 
    * We actually use
    * ASSIGN 1 TO SYSTEM(4001)
    * ASSIGN @(-13):@WHO:@(-14):' >':@FM:@(-13):@WHO:@(-14):' >>':@FM:'+' TO SYSTEM(4002)
    *__________________________________________________________________________
    *
    *
    * SYNTAX:   TCL.PROMPT SET [{value}]
    *           TCL.PROMPT RESET
    *
    * if {value} is not supplied with the SET command, then the
    * current @WHO value will be used.
    
    *
    * First, get our command line options
    *
    get(arg.) the.CMD else the.CMD = ""
    b.SET = (upcase(the.CMD) = "SET")
    b.RESET = (upcase(the.CMD) = "RESET")
    if not(b.SET) and not(b.RESET) then
       crt "SYNTAX:   TCL.PROMPT SET [{value}]"
       crt "          TCL.PROMPT RESET"
       crt
       crt "The SET command assigns a custom string as the TCL prompt."
       crt "If {value} is not supplied then the current @WHO value is used."
       crt
       crt "The RESET command resets the prompt back to the system default."
       crt
       stop
    end
    
    begin case
       case b.SET
          get(arg.) the.PROMPT else the.PROMPT = ''
          if len(the.PROMPT) = 0 then the.PROMPT = @WHO
          assign 1 to system(4001)
          assign @(-13):the.PROMPT:@(-14):' >':@AM:@(-13):the.PROMPT:@(-14):' >>':@AM:'+' to system(4002)
          
       case b.RESET
          assign 0 to system(4001)
    
    end case
    stop
    


    On our UV 11.3.5 it produces an interesting result:

    The "active select" prompt is using the UVPROMPT active select value and then showing the custom default text value.

    It seems that the "undocumented" feature has been compromised in recent releases.



    ------------------------------
    Gregor Scott
    Software Architect
    Pentana Solutions Pty Ltd
    Mount Waverley VIC AU
    ------------------------------



  • 8.  RE: Modify the system prompt '>'?

    PARTNER
    Posted 09-06-2023 21:08
    Edited by Gregor Scott 09-08-2023 03:13

    I also found that when SYSTEM(4001)= 1 then the TCL prompt no longer processes the <BACKSPACE> key!

    After running the TCL.PROPT RESET to turn it off the <BACKSPACE> key works again.

    Looks like a custom TCL prompt is a cleaner approach.



    ------------------------------
    Gregor Scott
    Software Architect
    Pentana Solutions Pty Ltd
    Mount Waverley VIC AU
    ------------------------------



  • 9.  RE: Modify the system prompt '>'?

    PARTNER
    Posted 09-06-2023 21:12

    it is interesting to note that the UVPROMPT command on  11.3.5 does allow for adjusting the prompt characters:

    >uvprompt # + >
    #SELECT VOC SAMPLE 1

    1 record(s) selected to SELECT list #0.
    +#LIST VOC _
    >F1

    LIST VOC  F1 11:09:51  07-09-23  PAGE    1
    VOC......... F1.............

    LOOP         K

    1 records listed.
    #

    I have yet to find a system function which identifies what the current prompt characters are, which makes it a challenge to implement a TCL CLI that properly responds to the UV setup.



    ------------------------------
    Gregor Scott
    Software Architect
    Pentana Solutions Pty Ltd
    Mount Waverley VIC AU
    ------------------------------



  • 10.  RE: Modify the system prompt '>'?

    Posted 09-07-2023 03:52
    All works fine here on 11.3.4, select prompt and backspace

    >TCL.PROMPT SET DEV-1
    DEV-1 >SELECT VOC SAMPLE 1

    1 record(s) selected to SELECT list #0.
    DEV-1 >>



    On Thu, 7 Sept 2023 at 02:12, Gregor Scott via Rocket Forum <
    Mail@forum.rocketsoftware.com> wrote:

    > it is interesting to note that the UVPROMPT command on 11.3.5 does allow
    > for adjusting the prompt characters: >uvprompt # + > #SELECT VOC...
    > Invite your colleagues to join the Rocket Forum and grow our expert
    > network.
    > ------------------------------
    > [image: Rocket Software] <https: community.rocketsoftware.com="">
    > Rocket U2 | UniVerse & UniData
    > <https: community.rocketsoftware.com/forums/forum-home/digestviewer?communitykey="dd45d00d-59db-4884-b3eb-2b0647af231b">
    > Post New Message Online
    > <http: community.rocketsoftware.com/participate/postmessage?groupid="49">
    > Invite your colleagues to join the Rocket Forum and grow our expert
    > network. Share this link. <https: community.rocketsoftware.com/register="">
    > Re: Modify the system prompt '>'?
    > <https: community.rocketsoftware.com/discussion/modify-the-system-prompt#bm5ab09659-d36b-46a5-8870-018a6d3157c1="">
    > Reply to Group Online
    > <https: community.rocketsoftware.com/forums/all-discussions/postreply?messagekey="5ab09659-d36b-46a5-8870-018a6d3157c1&ListKey=1daf02a1-f0f0-4a5c-a95d-a2b9f11dcf4b"> Reply
    > to Group
    > <rocket_universe_5ab09659-d36b-46a5-8870-018a6d3157c1@connectedcommunity.org?subject=re:+modify+the+system+prompt+'%3e'>
    > [image: Gregor Scott]
    > <https: community.rocketsoftware.com/network/members/profile?userkey="074cef70-95b8-4a77-a656-e1bf6b3f0c39">
    > Sep 6, 2023 9:12 PM
    > Gregor Scott
    > <https: community.rocketsoftware.com/network/members/profile?userkey="074cef70-95b8-4a77-a656-e1bf6b3f0c39">
    >
    > it is interesting to note that the UVPROMPT command on 11.3.5 does allow
    > for adjusting the prompt characters:
    >
    > >uvprompt # + >
    > #SELECT VOC SAMPLE 1
    >
    > 1 record(s) selected to SELECT list #0.
    > +#LIST VOC _
    > >F1
    >
    > LIST VOC F1 11:09:51 07-09-23 PAGE 1
    > VOC......... F1.............
    >
    > LOOP K
    >
    > 1 records listed.
    > #
    >
    > I have yet to find a system function which identifies what the current
    > prompt characters are, which makes it a challenge to implement a TCL CLI
    > that properly responds to the UV setup.
    >
    >
    >
    > ------------------------------
    > Gregor Scott
    > Software Architect
    > Pentana Solutions Pty Ltd
    > Mount Waverley VIC AU
    > ------------------------------
    > *Reply to Group Online
    > <https: community.rocketsoftware.com/forums/all-discussions/postreply?messagekey="5ab09659-d36b-46a5-8870-018a6d3157c1&ListKey=1daf02a1-f0f0-4a5c-a95d-a2b9f11dcf4b">*
    > *View Thread
    > <https: community.rocketsoftware.com/discussion/modify-the-system-prompt#bm5ab09659-d36b-46a5-8870-018a6d3157c1="">*
    > *Forward
    > <https: community.rocketsoftware.com/forums/all-discussions/forwardmessages?messagekey="5ab09659-d36b-46a5-8870-018a6d3157c1&ListKey=1daf02a1-f0f0-4a5c-a95d-a2b9f11dcf4b">*
    > *Flag as Inappropriate
    > <https: community.rocketsoftware.com/discussion/modify-the-system-prompt?markappropriate="5ab09659-d36b-46a5-8870-018a6d3157c1#bm5ab09659-d36b-46a5-8870-018a6d3157c1">*
    > *Post New Message Online
    > <http: community.rocketsoftware.com/participate/postmessage?groupid="49">*
    >
    > -------------------------------------------
    > Original Message:
    > Sent: 09-06-2023 21:07
    > From: Gregor Scott
    > Subject: Modify the system prompt '>'?
    >
    > I also found that when SYSTEM(4001) = then the TCL prompt no longer
    > processes the <backspace> key!
    >
    > After running the TCL.PROPT RESET to turn it off the <backspace> key
    > works again.
    >
    > Looks like a custom TCL prompt is a cleaner approach.
    >
    >
    > ------------------------------
    > Gregor Scott
    > Software Architect
    > Pentana Solutions Pty Ltd
    > Mount Waverley VIC AU
    >
    >
    >
    >
    > You are subscribed to "Rocket U2 | UniVerse & UniData" as
    > andy.baum@dpdgroup.co.uk. To change your subscriptions, go to My
    > Subscriptions
    > <https: community.rocketsoftware.com/preferences?section="Subscriptions">.
    > To unsubscribe from this community discussion, go to Unsubscribe
    > <https: community.rocketsoftware.com/higherlogic/egroups/unsubscribe.aspx?userkey="9dccff84-99e3-44dc-b97e-58bc92fc86d5&sKey=KeyRemoved&GroupKey=1daf02a1-f0f0-4a5c-a95d-a2b9f11dcf4b">
    > .
    >




  • 11.  RE: Modify the system prompt '>'?

    ROCKETEER
    Posted 09-07-2023 09:03

    Did a quick test with 11.3.5 and the select prompt and the backspace appear to work fine.

    >RUN BP SETPROMPT
    DEV-1 >SELECT VOC SAMPLE 1

    1 record(s) selected to SELECT list #0.
    DEV-1 >>
    DEV-1 >>.L RELLEVEL

         RELLEVEL
    001 X
    002 11.3.5
    003 NEWACC
    004
    005 11.3.5
    DEV-1 >>



    ------------------------------
    Neil Morris
    Universe Advanced Technical Support
    Rocket Software
    ------------------------------



  • 12.  RE: Modify the system prompt '>'?

    PARTNER
    Posted 09-08-2023 03:12

    That is interesting, Neil.

    We run with NLS active and use PICK style accounts - perhaps that makes the difference!




    ------------------------------
    Gregor Scott
    Software Architect
    Pentana Solutions Pty Ltd
    Mount Waverley VIC AU
    ------------------------------