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

Handling of symlink home directories #5525

Closed
zanchey opened this Issue Jan 13, 2019 · 9 comments

Comments

Projects
None yet
5 participants
@zanchey
Copy link
Member

zanchey commented Jan 13, 2019

On 3.0.0 and master, starting a shell with a home directory that is a symlink resolves the link, meaning that the prompt makes it look like you aren't in your home directory.

> mkdir /tmp/realhome
> ln -s /tmp/realhome /tmp/linkhome
> cd /tmp/linkhome
> pwd
/tmp/linkhome
> env HOME=/tmp/linkhome fish
Welcome to fish, the friendly interactive shell
zanchey@mussel /t/realhome>

@zanchey zanchey added this to the fish-future milestone Jan 13, 2019

@zanchey zanchey added the bug label Jan 13, 2019

@mqudsi

This comment has been minimized.

Copy link
Contributor

mqudsi commented Jan 13, 2019

This same behavior led me to open #5300. I agree that this behavior is unexpected.

@mqudsi

This comment has been minimized.

Copy link
Contributor

mqudsi commented Jan 17, 2019

I should mention that under FreeBSD the default home directory for each user is a symlink /home/jdoe pointing to /usr/home/jdoe.

@twlz0ne

This comment has been minimized.

Copy link

twlz0ne commented Jan 21, 2019

Same here, now I rolled back to 0f0bb1e^1

* ca159ae  Fix typo [Jason] 2018-10-07
* 786c0c5  Merge branch 'virtualpwd' [ridiculousfish] 2018-10-06
|\
| * 3e4bdf5  Teach hg prompt to use pwd -P [ridiculousfish] 2018-10-06
| * 0f0bb1e  Don't resolve symlinks with cd [ridiculousfish] 2018-09-16
| * 6ad4d94  (HEAD -> master) Introduce path_normalize [ridiculousfish] 2018-09-16
* | 02b093d  Change only to exactly [jacob] 2018-10-01
* | 739ad77  Fix typos and address formatting [jacob] 2018-10-01
|/
* 767b7a2  Migrate the completion set to owning_lock_t [ridiculousfish] 2018-10-05
@ridiculousfish

This comment was marked as off-topic.

Copy link
Member

ridiculousfish commented Jan 21, 2019

Cool, here's what would help

$ gdb fish
...
Program received signal SIGSEGV, Segmentation fault.
0x000000000048aa4c in env_get_runtime_path[abi:cxx11]() ()
(gdb) <---- START HERE

From within gdb, before quitting, it would be good to get a backtrace bt, a thread list: info threads, and a register dump: info registers

@floam

This comment was marked as off-topic.

Copy link
Member

floam commented Jan 21, 2019

This is the wrong issue I believe, @ridiculousfish

@ridiculousfish

This comment has been minimized.

Copy link
Member

ridiculousfish commented Jan 21, 2019

Whoops, thanks!

@ridiculousfish

This comment has been minimized.

Copy link
Member

ridiculousfish commented Jan 22, 2019

This is totally baffling! fish has code that respects incoming PWDs, and only asks the kernel for help (via getcwd) if $PWD is not provided as an incoming environment variable.

What I see is that env shows that $PWD is set, but fish doesn't see it in envp. As I said, baffling...

@ridiculousfish

This comment has been minimized.

Copy link
Member

ridiculousfish commented Jan 22, 2019

Aw hell, fish ignores incoming $PWD because it's considered read-only. But not at init time...

ridiculousfish added a commit that referenced this issue Jan 22, 2019

Correctly inherit a virtual PWD
PWD is not set in fish vars because it is read only.
Use getenv() to fetch it, allowing fish to inherit a virtual PWD.

This cherry pick includes both:
24f251e Correctly remove the test directory again in cd test
91a9c98 Correctly inherit a virtual PWD

Fixes #5525
@ridiculousfish

This comment has been minimized.

Copy link
Member

ridiculousfish commented Jan 22, 2019

Picked into 3.0.1 as dfa6192

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.