Issue 547 in xmonad: XMonad.Prompt.Shell does not open a prompt if a directory in PATH is inaccessible

Status: New Owner: ---- New issue 547 by ttue...@gmail.com: XMonad.Prompt.Shell does not open a prompt if a directory in PATH is inaccessible http://code.google.com/p/xmonad/issues/detail?id=547 What steps will reproduce the problem? 1. Add a directory to PATH that user does not have permission to access. 2. Try to open a shell prompt. What is the expected output? What do you see instead? The prompt does not appear. I would expect a prompt to open, although tab completion obviously will not know about commands below the inaccessible directory. What version of the product are you using? On what operating system? xmonad-0.11, xmonad-contrib-0.11.1 Solution: If a directory in the PATH is inaccessible, getDirectoryContents will throw an exception. The exception prevents the tab completion list from being compiled and the prompt from being opened. If an exception is encountered accessing any element of PATH for any reason, I think the response should simply be to return an empty list of commands for that element. I am attaching a patch that does exactly that. Attachments: catch-exceptions-when-finding-commands-on-path-in-prompt_shell.dpatch 8.8 KB -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings

Comment #1 on issue 547 by daniel.w...@gmail.com: XMonad.Prompt.Shell does not open a prompt if a directory in PATH is inaccessible http://code.google.com/p/xmonad/issues/detail?id=547 Is it enough to catch IOExceptions? If so, maybe it would be good to blend in with the surrounding style and use "`E.catch` econst []" instead of defining errHandler. Other than that, the patch looks good to me. -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings

Comment #2 on issue 547 by ttue...@gmail.com: XMonad.Prompt.Shell does not open a prompt if a directory in PATH is inaccessible http://code.google.com/p/xmonad/issues/detail?id=547 You're quite right, there seems to be no reason to catch other exceptions. Here's a new patch. Attachments: catch-exceptions-when-finding-commands-on-path-in-prompt_shell.dpatch 8.8 KB -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings

Updates: Status: Fixed Comment #3 on issue 547 by daniel.w...@gmail.com: XMonad.Prompt.Shell does not open a prompt if a directory in PATH is inaccessible http://code.google.com/p/xmonad/issues/detail?id=547 Applied, thanks! -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings
participants (1)
-
codesite-noreply@google.com