Skip to main content
r/commandline icon

r/commandline

members
online


Still on the fence about whether to get the all-new Galaxy S26 Ultra? Swipe below to see why it’s totally worth the upgrade. And if that's not enough, you'll also get up to $900 in savings when you pre-order today!
  • Image
    Still on the fence about whether to get the all-new Galaxy S26 Ultra? Swipe below to see why it’s totally worth the upgrade. And if that's not enough, you'll also get up to $900 in savings when you pre-order today!
  • Image
    Still on the fence about whether to get the all-new Galaxy S26 Ultra? Swipe below to see why it’s totally worth the upgrade. And if that's not enough, you'll also get up to $900 in savings when you pre-order today!
  • Image
    Still on the fence about whether to get the all-new Galaxy S26 Ultra? Swipe below to see why it’s totally worth the upgrade. And if that's not enough, you'll also get up to $900 in savings when you pre-order today!
  • Image
    Still on the fence about whether to get the all-new Galaxy S26 Ultra? Swipe below to see why it’s totally worth the upgrade. And if that's not enough, you'll also get up to $900 in savings when you pre-order today!
  • Image
    Still on the fence about whether to get the all-new Galaxy S26 Ultra? Swipe below to see why it’s totally worth the upgrade. And if that's not enough, you'll also get up to $900 in savings when you pre-order today!
  • Image
    Still on the fence about whether to get the all-new Galaxy S26 Ultra? Swipe below to see why it’s totally worth the upgrade. And if that's not enough, you'll also get up to $900 in savings when you pre-order today!



Understanding the $VISUAL env var Understanding the $VISUAL env var
Help

I'm trying to better understand VISUAL -- where it is documented, how it relates to EDITOR, and when VISUAL versus EDITOR gets used by external programs.

While working on a recent blog post, I was trying to demonstrate that when I have EDITOR=nvim in my zsh env, but then I override that for a specific command (like so EDITOR="code --wait" rails console), then when I run edit from rails console it will open VS Code instead of Neovim. It didn't work though. It was continuing to open with Neovim. I did some sleuthing and discovered that another env var in my zsh config VISUAL=nvim was actually what was being used to determine the default editor program. Once I changed it to VISUAL="code --wait" rails console then it opened in VS Code instead.

So to reiterate, I'm trying to understand the history behind VISUAL, where it is documented, and how it relates to EDITOR. I appreciate any insights on this!