Opened 7 years ago

Last modified 16 months ago

#3984 new feature request

Handle multiline input in GHCi history

Reported by: aavogt Owned by:
Priority: normal Milestone:
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 Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

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 7 years ago.
patch for ghci-haskelline

Download all attachments as: .zip

Change History (23)

comment:1 Changed 7 years ago by aavogt

Component: CompilerGHCi
Type: bugfeature request

comment:2 Changed 7 years ago by igloo

Milestone: 6.14.1

Changed 7 years ago by aavogt

patch for ghci-haskelline

comment:3 Changed 7 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 7 years ago by tibbe

Cc: johan.tibell@… added

comment:5 Changed 7 years ago by igloo

Status: newpatch

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

comment:6 Changed 7 years ago by igloo

Owner: set to igloo

comment:7 Changed 7 years ago by igloo

Resolution: fixed
Status: patchclosed

Applied, thanks!

comment:8 Changed 7 years ago by igloo

Owner: igloo deleted
Resolution: fixed
Status: closednew

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 7 years ago by vivian

Cc: haskell.vivian.mcphail@… added

comment:10 Changed 7 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 6 years ago by igloo

Milestone: 7.0.17.0.2

comment:12 Changed 6 years ago by igloo

Milestone: 7.0.27.2.1

comment:13 Changed 6 years ago by dterei

Cc: dterei added

comment:14 Changed 6 years ago by igloo

Milestone: 7.2.17.4.1

comment:15 Changed 5 years ago by dterei

Description: modified (diff)
Summary: interpret layout in GHCiHandle multiline input in GHCi history

Edited ticket to reflect actual work needing to be done.

comment:16 Changed 5 years ago by igloo

Milestone: 7.4.17.6.1

comment:17 Changed 5 years ago by igloo

Milestone: 7.6.17.6.2

comment:18 Changed 4 years ago by leroux

Cc: leroux@… hvr added
difficulty: Unknown

comment:19 Changed 3 years ago by thoughtpolice

Milestone: 7.6.27.10.1

Moving to 7.10.1.

comment:20 Changed 2 years ago by thoughtpolice

Milestone: 7.10.17.12.1

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:21 Changed 21 months ago by thoughtpolice

Milestone: 7.12.18.0.1

Milestone renamed

comment:22 Changed 16 months ago by thomie

Milestone: 8.0.1
Note: See TracTickets for help on using tickets.