codebytere / codebytere/codebytere.github.io

`..` has weird semantics

未关闭
#9 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
546
派生
105
PR 合并指标
30 天内没有已合并 PR

描述

`..`, which should be "1 directory above `cwd`" seems to actually have different semantics. Moreover, few other issues.

To repro:
1. `cd projects`
2. `clear`
3. Run the commands in the screenshot

![image](https://user-images.githubusercontent.com/1797812/45268008-409f0180-b43c-11e8-8a01-fd0869fa1b86.png)

Issues:
1. After `clear`, it says I'm in `root/`, even though I'm actually still in `projects/`. The `ls` verifies I'm in `projects/` and then lists the files there
2. `ls ..` should list files in the parent directory, but actually lists files in the current directory (like `ls .`) which leads me to believe `..` has the same semantics of `.`
3. `cd ..` says "not a valid directory" even though, it should either (according to issue 2), not change directories and just stay in the current one without an error, or it should actually go to `root/` according to standard semantics for this

Known workaround:
Refresh 😂

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。