Zsh change cursor color to indicate vi mode

Hello, I have written this for the .zshrc to change the cursor color to red when in cmd mode on the zsh command line.
zle-keymap-select () {
if [ $KEYMAP = vicmd ]; then
echo -ne "\033]12;Red\007"
else
echo -ne "\033]12;Grey\007"
fi
zle -N zle-keymap-select
zle-line-init () {
zle -K viins
echo -ne "\033]12;Grey\007"
zle -N zle-line-init
bindkey -v
It works well in urxvt however my tty does not know what to do with the escape codes so It just prints them to the command line. Is there any command for changing the cursor color that is for urxvt only? I think this would fix the problem.
Thanks,
Andreas

Cool! The extra $TERM conditional works. Thank you.
With xterm the color changing does not work as well, the cursor color only changes back to insert-mode-color once text is being typed.
This is working for me. I may simplify it later.
zle-keymap-select () {
if [ $TERM = "rxvt-256color" ]; then
if [ $KEYMAP = vicmd ]; then
echo -ne "\033]12;Red\007"
else
echo -ne "\033]12;Grey\007"
fi
fi
zle -N zle-keymap-select
zle-line-init () {
zle -K viins
if [ $TERM = "rxvt-256color" ]; then
echo -ne "\033]12;Grey\007"
fi
zle -N zle-line-init
bindkey -v
There are many colorname choices in /usr/share/X11/rgb,txt
You can also add colors. Or just use rgb values directly, apparently. More about the color stuff here.
EDIT: You can just use the hex as you defined it in your .Xdefaults:
echo -ne "\033]12;#83C048\007"
Last edited by AndreasBWagner (2010-05-01 02:48:28)

Similar Messages

  • Change background color in enter-query mode

    Hi everyone,
    I am trying to Change background color in enter-query mode in forms10g. I am using this
    Set_Item_property('org.branch_code', BACKGROUND_COLOR, 'Green' );
    Thanks

    This is the code that allows to colorise items in enter_query mode, then de-colorize them after execute_query.
    Assume that you have created a VA_QUERY visual atribute in your module.
    -- Colorise in enter-query mode --
    PROCEDURE Start_query IS
      LC$Block      Varchar2(30) := Name_in('system.trigger_block') ;
      LC$item       varchar2(60);
      LC$itemdeb    varchar2(60);
      LN$len        pls_integer ;
    BEGIN
      lc$itemdeb := get_block_property(LC$BLOCK, FIRST_ITEM) ;
      lc$item := LC$BLOCK || '.' || lc$itemdeb ;
      while lc$itemdeb is not null Loop
        IF GET_ITEM_PROPERTY(LC$Item , ITEM_TYPE) NOT IN ('BUTTON','RADIO GROUP','DISPLAY ITEM') Then
          IF GET_ITEM_PROPERTY(LC$Item , QUERYABLE ) = 'TRUE' Then
            set_item_property(LC$item, CURRENT_RECORD_ATTRIBUTE, 'VA_QUERY');
          End if ;
        End if ;
        lc$itemdeb := get_item_property( lc$item, NEXT_NAVIGATION_ITEM );
        lc$item := LC$BLOCK || '.' || lc$itemdeb ;
      end loop ;
    END;
    -- Unclororize after execute_query --
    PROCEDURE End_query IS
      LC$Block     Varchar2(30) := Name_in('system.trigger_block') ;
      LC$item     varchar2(60);
      LC$itemdeb     varchar2(60);
      LN$len          pls_integer ;
      LN$Multi  pls_integer ;
    BEGIN
      lc$itemdeb := get_block_property(LC$BLOCK, FIRST_ITEM) ;
      lc$item := LC$BLOCK || '.' || lc$itemdeb ;
      LN$Multi := GET_BLOCK_PROPERTY(LC$Block , RECORDS_DISPLAYED ) ;
      while lc$itemdeb is not null Loop
        IF GET_ITEM_PROPERTY(LC$Item , ITEM_TYPE) NOT IN ('BUTTON','RADIO GROUP','DISPLAY ITEM') Then
          IF GET_ITEM_PROPERTY(LC$Item , QUERYABLE ) = 'TRUE' Then
             If LN$Multi > 1 Then
                set_item_property(LC$item, CURRENT_RECORD_ATTRIBUTE, 'VA_CURRENT_RECORD');
             Else
                set_item_property(LC$item, CURRENT_RECORD_ATTRIBUTE, '');
             End if ;
          End if ;
        End if ;
        lc$itemdeb := get_item_property( lc$item, NEXT_NAVIGATION_ITEM );
        lc$item := LC$BLOCK || '.' || lc$itemdeb ;
      end loop ;
    END;Francois

  • Customizing Cursor Color and/or appearance:  Does anyone know if you can change cursor color?

    Customizing Cursor Color and/or appearance:  Does anyone know if you can change cursor color in Mountain Lion? Any software for customizing and saving different cursors for Mountain Lion? Already have cursor size changed, but would like more options. Are more cursor customization options coming in future Mac OS X versions?

    There may be some haxies/3rd party s/w that can do this, but I've not heard of them.
    Customisation is limited on macs, unless you start hacking deep into the coreservices of the system - dodgy at best and almost certainly to get reset on the next update from Apple central
    Think different? Nooo....that was just a slogan.

  • Change background color during text edit mode

    THis is a wacky problem...
    I have a presentation template. The slide master has white copy in the title and black copy in the body/bulleted list.
    When I try to use the template and edit the title copy, the background color for editing that line is white, just like the text, so I can't see what I'm typing. I can't figure out how to change the background color during text edit mode so that I can actually see what I'm typing. Is there a way to make this transparent?
    For some reason, the body copy edit works fine: black text edited in either a white or transparent background color.
    help!

    THis is a wacky problem...
    I have a presentation template. The slide master has white copy in the title and black copy in the body/bulleted list.
    When I try to use the template and edit the title copy, the background color for editing that line is white, just like the text, so I can't see what I'm typing. I can't figure out how to change the background color during text edit mode so that I can actually see what I'm typing. Is there a way to make this transparent?
    For some reason, the body copy edit works fine: black text edited in either a white or transparent background color.
    help!

  • Changing Cursor Color

    can i change the cursor color beside changing its type ??

    I thought Toolkit.createCustomCursor was used for this sort of thing.
    You don't seem to be able to capture the Image representing a system cursor, however, so can't base a custom cursor on changing the colour of a system one.
    You could probably get around this by using a custom cursor for your entire application (or at least the part that requires its colour to change) and use colourised versions of that as appropriate.
    Hope this helps.

  • Photoshop 6 and the change in Color Dodge/Burn blend modes

    Photoshop 6 introduced a few changes in blending modes. Here´s a tip on how to save those older PSD´s, and continue with the Color Dodge/Burn behaviour you are used to:
    Courtesy of Mark Hamburg, verified and posted by Chad Baker:
    To create a new Color Dodge/Burn layer that will work like the old ones used to, simply Option (Alt) click the New Layer icon and select Color Dodge/Burn as your mode, then check the box to fill your new layer with a neutral color (black for Color Dodge and Difference, white for Color Burn).
    To fix an existing Color Dodge/Burn layer (from one of your 5.5 files for example) that has 100% layer opacity, simply bring up the fill dialog with that layer selected, then fill the layer in 'Behind' mode with black.
    To fix an existing Color Dodge/Burn layer that has an opacity of other than 100% it's a little trickier, but not much. The process is the same as above, but you must perform a quick trick first. Select the layer, then go to Layer>Layer Style>Blending Options. What you need to do is change the Advanced blending opacity to whatever your General blending opacity is, then move the general opacity up to 100%. Now all you have to do is what you did before, fill the layer in 'Behind' mode with black.
    See also:
    Adobe Techdoc#321884

    Very bad practice to just use image slices into your website.
    Check out this tutorial to learn how to efficiently slice, dice and markup your design into an active HTML format - http://net.tutsplus.com/articles/news/slice-and-dice-that-psd/
    Also, Spry - has been deprecated and is no longer officially supported by Adobe. http://blogs.adobe.com/dreamweaver/2012/08/update-on-adobe-spry-framework-availability.htm l
    Consider using a jQuery menu.
    -Sudarshan

  • Change cursor color

    Hello,
         I've got a simple coloring book that I'm developing. I've got most everything working but I'm having trouble getting the cursor to pick up the active color from a color array.
    The cursor is a movieclip called "mycursor_mc" There is a movie clip inside this called "CursorFill". I am trying to get the "CursorFill" movie clip to change to the currentColour value from the dynamic property array index.
    This is the section I was working on but it's not working:
    var mycursor_mc:cursor = new cursor();
    addChild(mycursor_mc);
    var m = new CursorFill();
         mycursor_mc.addChild(m);
    Here's the whole Action script:
    //Array to hold the colours
    var colorArray:Array=new Array(0xE97DB1,0xF58240,0xF9ED41,0x82C34D,0x00B0F0,0x935CA4,0xFFFFFF);
    //A new instance of the colour transform class.
    var colorTrans:ColorTransform=new ColorTransform;
    var currentColor:int=0;
    //This adds the ovals on the stage with the corresponding colour from the array
    //and with the mouse click event.
    for (var i:int = 0; i < colorArray.length; i++) {
         var marker:Sprite = new Sprite();
         marker.y=500+i*50;
         var c = new MarkerFill();
         c.buttonMode=true;
         marker.addChild(c);
         colorTrans.color=colorArray[i];
         c.transform.colorTransform=colorTrans;
         c.addEventListener(MouseEvent.CLICK, ovalsClick);
         c.arrayIndex=i;
         var o:Outline = new Outline();
         marker.addChild(o);
         addChild(marker);
    //This creates a new instance of the cursor movie clip and adds it onto
    //the stage using the addChild method.
    var mycursor_mc:cursor = new cursor();
    addChild(mycursor_mc);
    var m = new CursorFill();
         mycursor_mc.addChild(m);
    //Hides the default cursor on the stage so it will not be shown.
    Mouse.hide();
    //Adds an event listener onto the stage with the enter frame event which
    //repeatedly executes the moveCursor function.
    stage.addEventListener(Event.ENTER_FRAME, moveCursor);
    //This function set the x & y positions of the custom cursor to the x & y positions
    //of the default cursor.
    function moveCursor(event:Event) {
      mycursor_mc.x=mouseX;
      mycursor_mc.y=mouseY;
    //This sets the currentColour value from the dynamic property array index.
    function ovalsClick(e:MouseEvent):void {
         currentColor=e.currentTarget.arrayIndex;
    //Adds the mouse click event to the holder.
    holder.addEventListener(MouseEvent.CLICK, holderHandler);
    //This function changes the colour of the movie clip inside
    //holder when it is clicked.
    function holderHandler (e:MouseEvent):void {
       for (var i:int = 0; i < holder.numChildren; i++) {
           if (holder.getChildAt(i).hitTestPoint(mouseX,mouseY,true)) {
               colorTrans.color=colorArray[currentColor];
               holder.getChildAt(i).transform.colorTransform=colorTrans;

    That's strange. Try tracing few things to make sure everything works as it should:
    function ovalsClick(e:MouseEvent):void {
         currentColor = e.currentTarget.arrayIndex;
         trace(e.currentTarget, currentColor, colorArray[currentColor]);
         var trans:ColorTransform = new ColorTransform();
         trans.color = colorArray[currentColor];
         m.transform.colorTransform = trans;

  • Change cursor color in Illustrator CS5

    My cursor has decided to display in an impossibly light blue. I want my black cursor back. What do I do?
    Thanks,
    Dave

    Just use the key combo I gave above. It will reset the Preferences to the default which should mean a black cursor.

  • Changing cursor color?  magnifying glass?

    Anyone recommend a 3rd party set of cursors to use in Logic?
    I'd love to have a bright red cursor that I could easily see.
    Also, I'd love a magnifying glass tool. Some of Logic's text is just too small to see at the resolution where I'm basically happy with 95% of it.

    Not sure if any of these will work with the Intel Macs, but you can ask the developer to see if they do:
    http://www.unsanity.com/haxies/mightymouse/
    http://www.boinx.com/mousepose/
    http://www.joar.com/cursorzoom/
    http://www.artissoftware.com/screentools/loupe.html
    http://www.subrosasoft.com/OSXSoftware/index.php?mainpage=product_info&cPath=5&productsid=15
    http://www.katsurashareware.com/ both RealZoom and RealZoom Quartz.
    You can find many other Mac software titles on my FAQ http://www.macmaps.com/macosxnative.html
    's listing of Mac OS X software search engines and the section under Intel for Intel Universal and known Rosetta compatible software.
    Be aware system hacks like these can often break when the operating system updates, so check for updates of any such hack before upgrading your operating system.

  • Pages 5 can't change background color in fullscreen

    There's no option to change background color when in fullscreen mode anymore.
    Did I miss something or did apple just...get rid of it?????why???

    Hi, Mark,
    Under the Format menu select Advanced and the click on Make Master Objects Selectable. Now click on the red area. You'll notice little faint x's at the corners. In the Arrange menu click on Unlock. Now you can edit the color. (In this case a gradient.) When you finish, go back and Lock it again and deselect Make Master Object Selectable.
    Walt

  • Changing the Cursor Color

    Is anyone aware of a way to change the color of the cursor from black to a lighter color? White or a light gray would be ideal.
    I am working with a document that has a dark background that even shifts to black in certain areas. The problem is that I can hardly ever see the cursor so I often loose my place while jumping around doing edits.
    I know that hiding the background would let me see the cursor however since I am using a light font hiding the background would require that I switch my styles back to dark colors and then back again and that would be a pain.
    Rob

    I'm sure there are a number of third-party system utilities or haxies that can do this. I suggest a search on MacUpdate or VersionTracker, perhaps looking for "cursor" to start.

  • Changing textfield cursor color in Forms

    Hi All,
    We are using Oracle App Server 9iAS and 9iDS. I need to change the color of my cursor for the text field/or change the cursor to a block cursor in forms application. Does any one know how that can be done ?.
    TIA
    Saurabh

    Saurabh,
    changing the color of a cursor is more difficult than changing its shape. You can use a PJC to change the cursor shape to one of the standard shapes. If you need a custom cursor then you still can used a PJC, but designing your own cursors in Java is not trivial.
    See:
    http://www.oracle.com/technology/sample_code/products/forms/demo/9i/javabeans_pjc_samples/mod_cursor/viewlet/pjc_modcursor_viewlet.html
    which is available in the Forms 9i demos at
    http://www.oracle.com/technology/sample_code/products/forms/index.html
    Frank

  • UITextView: changing the color of the cursor

    Hi all!
    Is it possible to change the color of the cursor in the UITextView?
    Thank you,
    Luca

    I've found out that in this way it works:
    [[myUITextField  valueForKey:@"textInputTraits"] setValue:[UIColor redColor] forKey:@"insertionPointColor"];
    but I cannot understand whether it is allowed by Apple and if an app using it could be rejected.
    Any idea?
    Thanks,
    Luca

  • Cursor color change according to background

    The default cursor is Black, and black tool-tips (such as slashes, carats, circles, eyedrop, etc...).  However, I have trouble tracking down a certain line segment or end-point when I can't see the black slash on the thick black border.   All I can do is change the item to white, make my selection, make the connection, then change it back to black.  Very time consuming and interrupts the creative flow.
    Is there a plug-in or setting so that the cursor color changes from black to white according to the darkness/lightness of the background?    Or am I simply SOL?

    Nope, that stuff is hard-coded. If you have difficulty in detecting thin elements, I suggest you use the colored paper simulation in the doc settings/ prefs and assign som contrasty color temporarily If you e.g. work with black and white, obviously something like a dirty lime green or greenish grey will work perfectly rfor both colors...
    Mylenium

  • How do I change the Color of the Cursor?

    Hi!
    I have changed the background color of a JTextField. Unfortunately the background color of the textfield is almost identical with the color of the cursor, so the cursor cannot be seen when the mouse pointer points into the textfield.
    Is there a way to change the color of the cursor and can this be done using the UIManager?
    Thanks,
    Alex

    I think you need to create a custom cursor from an image like .gif or .jpg.
    Look in to the javadoc of java.awt.Toolkit class for creating a custom cusrosor.
    toolkit.createCustomCusror(...)
    After creating the cursor, set the cursor on the desired components using component.setCursor(myCursor).
    Hope this helps
    Sai Pullabhotla

Maybe you are looking for

  • IMac Hardware Advice

    So I've decided to buy a new iMac (27 inch) in the next few weeks- Can anyone suggest a good hardware configuration? When buying the computer, they list a few customization options here: http://store.apple.com/us/buy-mac/imac?product=ME089LL/A&step=c

  • J2EE add-in

    I have installed a distributed add in J2EE instance. It forced me to create an ABAP dialog instance. Is anyone farmiliar with how all theese instances are started and stopped? By means of sap scrips. Does it modify the start sap script? Is the SCS in

  • Camtasia SWF and Robohelp x5 - Please help!

    I think the summary says it all. I produce a swf file using Camtasia (a well known and popular video producer) and when I include all the video files in the project, nothing shows up after it's compiled (there are 4 files: an swf video, controller ht

  • Too many items in dock

    I accidentally moved an entire i-tunes library onto my dock. Now it contains over 1000+ files. How can I remove these. It's possible to remove them one at a time BUT this will take forever.

  • Target Vs. Achievement Report

    Dear All, We need to create one report regarding Target Vs. Achievement Report which should be based  on Zone/Region wise & period wise.(Quqntity and Value) So is there any standard report available? Regards Debasish