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,312
    • Issues 4,312
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 385
    • Merge Requests 385
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #13437

Closed
Open
Opened Mar 17, 2017 by Frederik Hanghøj Iversen@fredefoxReporter

Easier editing of multi-line GHCi-commands

In my terminal emulator I can write something like:

cat > /dev/null << EOF
bla
bla
bla
EOF

If I later want to edit something in this command I can recall the command from history and I can navigate to the line I want to change. In GHCi this is not possible, the history only recalls *one line* at a time. It would be nice if it recognized commands entered using :{ ... }: and would give you that whole command when recalling commands from the history.

Also, it would be very handy if holding down a modifier key when hitting enter (e.g. Shift) would insert a newline into your multi-line command rather than run the command.

Furthermore, it could also serve as a handy shortcut for engaging the multi-line command mode. So say you were sitting at the prompt > and you then hit Shift+Enter, then GHCi moves to a new-line but has inserted the :{ part for you, it could similarly close the command for you when you hit Enter (without holding down the modifier key).

I believe this change would make GHCi's multi-line command mode way more useful. Currently I very seldomly (if ever) use GHCi for anything other than one-liners. This means that I usually have to edit the source-file I'm currently working on to put things into scope (or try and formulate a long and awkward expression).

Edited Mar 10, 2019 by Frederik Hanghøj Iversen
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#13437