"edit" doesn't use environment variable.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aarono Brown

    #1

    "edit" doesn't use environment variable.

    I've seen this question asked a couple times in this forum
    but never answered, so I guess my hopes aren't too high,
    but:

    I'm running
    [color=blue]
    > mysql Ver 12.21 Distrib 4.0.14, for pc-linux (i686)[/color]

    on Linux with Bash and according to the documentation,
    [color=blue]
    > edit (\e) Edit command with $EDITOR.[/color]

    Although my $EDITOR is set to /usr/bin/vim, when I use the
    edit or \e command, the editor is started as vi (in my case
    it's still vim, but it gets started in vi-compatible mode,
    which I don't like).

    Is $EDITOR perhaps being sought in mysqld's environment
    instead of mysql's? That doesn't seem like the right thing
    to do, but if so, is there a workaround (that wouldn't
    involve making everybody who uses this server use the same
    editor)?

    --
    Aaron
  • Aarono Brown

    #2
    Re: "edit&quot ; doesn't use environment variable.

    I wrote:
    [color=blue]
    > Although my $EDITOR is set to /usr/bin/vim, when I use the
    > edit or \e command, the editor is started as vi (in my
    > case it's still vim, but it gets started in vi-compatible
    > mode, which I don't like).[/color]

    Oops! I had to wait until my post appeared before I could
    reply to it, but I got some local help and this turned out
    to have nothing to do with MySQL. Here's what was
    happening: In my .bash_profile I was setting my editor:

    EDITOR=/usr/bin/vim

    but I was forgetting to export it:

    export PATH

    So I just changed the above line to

    export PATH EDITOR

    and now everything works as advertised in the MySQL manual.

    Sorry for the bother!

    --
    Aaron

    Comment

    Working...