[GHC] #13697: Teach GHCi to deduplicate history

#13697: Teach GHCi to deduplicate history -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- GHCi's (or rather, Haskeline's) history functionality tends to duplicate entries, even when the user used history to enter an entry. This is quite annoying and an issue I've not noticed in other command line libraries. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13697 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13697: Teach GHCi to deduplicate history -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * component: Compiler => GHCi -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13697#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13697: Teach GHCi to deduplicate history -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): My command prompt (Mac's `Terminal`) doesn't do this (that is, deduplicate). It's not behavior I would expect. Where can I witness this in action? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13697#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13697: Teach GHCi to deduplicate history -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Here's a quick reproducer, 1. Start `ghci`. 2. Enter a command: `putStrLn "hello" <enter>` 3. Enter another command; `putStrLn "hi again" <enter>` 4. Press `<up arrow>` once to select the `hi again` command, press `<enter>` 5. You will now need `<up arrow>` three times to get back to the `hello` command as the `hi again` command appears twice in history. This is in contrast to, e.g. `bash`, where it will only appear once. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13697#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13697: Teach GHCi to deduplicate history -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by nomeata): What I observe in bash (and miss in ghci as well) is that {{{ $ ls $ ls $ history |tail -n 3 4992 man bash 4993 ls 4994 history |tail -n 3 }}} i.e. there are no *successive* duplicated entries. But {{{ $ ls $ echo hi $ ls $ history |tail -n 4 4995 ls 4996 echo hi 4997 ls 4998 history |tail -n 4 }}} so there is no duplication of everything. I believe the OP asks for the former (and I support this.) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13697#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

so there is no duplication of everything. I believe the OP asks for the
#13697: Teach GHCi to deduplicate history -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): former (and I support this.) Exactly; I should have been more clear about this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13697#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13697: Teach GHCi to deduplicate history -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): I'm very confused. The following is on a Linux machine: {{{ 12:22:05@powerpuff ~> echo $0 -bash 12:22:27@powerpuff ~> echo "hello" hello 12:22:33@powerpuff ~> echo "hello" hello 12:22:35@powerpuff ~> history | tail -n 4 510 echo $0 511 echo "hello" 512 echo "hello" 513 history | tail -n 4 12:22:41@powerpuff ~> }}} I have no recollection of ever considering this issue, so I don't believe I've set a configuration somewhere to change it. (And I looked at my `.bashrc` and see nothing working in this direction.) It's not that I'm opposed to the feature as proposed, exactly, but I feel like I'm missing some small superpower that the rest of you share... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13697#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13697: Teach GHCi to deduplicate history -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Ahh, indeed, it seems that I, long ago in a place far far away, added this incantation to my `bashrc`, {{{#!bash export HISTCONTROL=ignoredups ignorespace }}} I suspect this is responsible. In this case we may want to keep Haskeline's current behavior as-is, but it would be nice if `~/.haskeline` would have a similar option. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13697#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13697: Teach GHCi to deduplicate history -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => invalid Comment: Ahhh, [[https://github.com/judah/haskeline/wiki/UserPreferences|it seems]] that this already exists. Just, {{{#!bash echo "historyDuplicates: IgnoreConsecutive" >> ~/.haskeline }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13697#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC