Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,393
    • Issues 4,393
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 378
    • Merge Requests 378
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #19030

Closed
Open
Opened Dec 06, 2020 by Olius@Olius

Check $VISUAL before $EDITOR

Motivation

Currently GHCi checks the $EDITOR environment variable to set the editor which is launched by :edit. There is another environment variable $VISUAL which is also used for selecting the default editor on Unix. I use both, but as is suggested in this post on StackExchange, I set $EDITOR to ex and $VISUAL to vi. Thus GHCi always launches ex instead of the desired vi.

Proposal

I suggest simply checking the $VISUAL variable first, and only if it is unset then using $EDITOR. Other command-line tools do this, for example Git.

The change would have to be made here I think. I don't know enough about monads or IO to do this myself though.

GHCi feature request Plow

Edited Dec 06, 2020 by Olius
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#19030