
#8172: Expose CWD and import search paths in GHCi via new `:show paths` command -------------------------------------------+------------------------------- Reporter: hvr | Owner: hvr Type: feature request | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.7 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Easy (less than 1 hour) | Type of failure: Blocked By: | None/Unknown Related Tickets: | Test Case: | Blocking: -------------------------------------------+------------------------------- - Currently, GHCi provides a `:cd` command but no respective builtin command to query the currently set path. - Moreover, there's no obvious way to query the currently active `importPaths` dynamic flags field, to find out which `-i` options are currently in effect. The attached patch extends `:show` with a `:show paths` subcommand, printing the CWD and the current value of `importPaths`: {{{ Ok, modules loaded: Main, InteractiveUI, Paths_ghci_ng, GhciMonad, GhciTags. λ> :show paths current working directory: /home/hvr/Haskell/My/ghci-ng module import search paths: dist/build/ghci-ng/ghci-ng-tmp ghc dist/build/autogen λ> :set -i λ> :show paths current working directory: /home/hvr/Haskell/My/ghci-ng module import search paths: none
:cd /tmp Warning: changing directory causes all loaded modules to be unloaded, because the search path has changed.
:show paths current working directory: /tmp module import search paths: none }}}
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8172 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler