Opened 4 years ago

Last modified 6 months ago

#3984 new feature request

Handle multiline input in GHCi history

Reported by: aavogt Owned by:
Priority: normal Milestone: 7.6.2
Component: GHCi Version: 6.12.1
Keywords: Cc: vogt.adam@…, johan.tibell@…, haskell.vivian.mcphail@…, dterei, leroux@…, hvr
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by dterei)

GHCi accepts multiline input in the form of:

Prelude> :{
Prelude|   let f = do
Prelude|         print "Hello"
Prelude|         print "World"
Prelude|   :}

OR of the form:

Prelude> :set +m
Prelude|   let f = do
Prelude|             print "Hello"
Prelude|             print "World"
Prelude|   
Prelude>

However, recalling mulitline input from history (with the <Up> key or <C-p>) recalls it as its individual lines, not the whole input. Ideally multiline should be one history entry and allow proper editing of the recalled text.

Attachments (1)

re_add-newlines-to-enable-layout-for-multi_line-input_.dpatch (2.4 KB) - added by aavogt 4 years ago.
patch for ghci-haskelline

Download all attachments as: .zip

Change History (19)

comment:1 Changed 4 years ago by aavogt

  • Component changed from Compiler to GHCi
  • Type changed from bug to feature request

comment:2 Changed 4 years ago by igloo

  • Milestone set to 6.14.1

Changed 4 years ago by aavogt

patch for ghci-haskelline

comment:3 Changed 4 years ago by aavogt

The attached patch allows ex.

Prelude> :{
Prelude| let x = 1
Prelude|     y = 2
Prelude| in x + y
Prelude| :}
3

But the history part of this isn't done.

comment:4 Changed 4 years ago by tibbe

  • Cc johan.tibell@… added

comment:5 Changed 4 years ago by igloo

  • Status changed from new to patch

Thanks for the patch! We'll take a look.

comment:6 Changed 4 years ago by igloo

  • Owner set to igloo

comment:7 Changed 4 years ago by igloo

  • Resolution set to fixed
  • Status changed from patch to closed

Applied, thanks!

comment:8 Changed 4 years ago by igloo

  • Owner igloo deleted
  • Resolution fixed deleted
  • Status changed from closed to new

We still need to fix the editing, e.g. "up" should give you the whole multi-line input at once, rather than giving it to you line-by-line.

comment:9 Changed 4 years ago by vivian

  • Cc haskell.vivian.mcphail@… added

comment:10 Changed 3 years ago by vivian

I have uploaded a patch to the Haskeline trac page #112 that provides a "getMultiLine" command and inserts it in the history as a single entry.

It does not fix editing a multiline command.

comment:11 Changed 3 years ago by igloo

  • Milestone changed from 7.0.1 to 7.0.2

comment:12 Changed 3 years ago by igloo

  • Milestone changed from 7.0.2 to 7.2.1

comment:13 Changed 3 years ago by dterei

  • Cc dterei added

comment:14 Changed 3 years ago by igloo

  • Milestone changed from 7.2.1 to 7.4.1

comment:15 Changed 2 years ago by dterei

  • Description modified (diff)
  • Summary changed from interpret layout in GHCi to Handle multiline input in GHCi history

Edited ticket to reflect actual work needing to be done.

comment:16 Changed 2 years ago by igloo

  • Milestone changed from 7.4.1 to 7.6.1

comment:17 Changed 19 months ago by igloo

  • Milestone changed from 7.6.1 to 7.6.2

comment:18 Changed 6 months ago by leroux

  • Cc leroux@… hvr added
  • Difficulty set to Unknown
Note: See TracTickets for help on using tickets.