Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shell integration: properly handle filenames starting with tilde #5803

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ users)
## Plugins

## Init
* [BUG] Shell integration: properly handle filenames starting with tilde [#5803 @ElectreAAS, fixes #5801]

## Config report

Expand Down
8 changes: 2 additions & 6 deletions src/state/opamEnv.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1235,13 +1235,9 @@ let setup
menu shell (OpamStd.Option.map OpamFilename.of_string (OpamStd.Sys.guess_dot_profile shell))
default
| `Change_file ->
let open OpamStd.Option.Op in
let dot_profile =
(OpamConsole.read "Enter the name of the file to update:"
>>| (fun f ->
if Filename.is_implicit f then Filename.concat (OpamStd.Sys.home ()) f
else f)
>>| OpamFilename.of_string)
OpamStd.Option.map OpamFilename.of_string @@
OpamConsole.read "Enter the name of the file to update:"
in
menu shell dot_profile `Yes
in
Expand Down