vercel / vercel/hyper

Tab crashes when opening in a missing CWD

Open
#7,581 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
44.7k
Forks
3.6k
Avg merge
21m
Merged PRs (30d)
1

Description

  • I am on the latest Hyper.app version

  • I have searched the issues of this repo and believe that this is not a duplicate

  • OS version and name: Fedora 38

  • Hyper.app version: 3.4.1

  • Link of a Gist with the contents of your hyper.json: hyper config gist

  • Relevant information from devtools: N/A

  • The issue is reproducible in vanilla Hyper.app: No change after disabling all extensions. Presumably config with preserveCWD: true would not be affected by the same steps.

Issue

Steps:

  1. Launch hyper
  2. Have preserveCWD: true in config
  3. mkdir test
  4. cd test
  5. rm -r ../test
  6. Open a new tab

Observed:
Error messages scrolling by very quickly, followed by the tab closing.

Expected:
A new tab to open in the closest existing ancestor of the missing directory, or other reasonable fall-back behaviour.

Notes:

  • This happens with both fish and sh shells.
  • A screenshot showing part of the error message seen. Most or all of the errors appear to be the same as this, though it goes too fast for me to be sure (also, it closes too fast for me to copy the text, so please excuse the screenshot). the image just described
  • Running the hyper command from a missing directory also fails:
    shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
    node:internal/bootstrap/switches/does_own_process_state:126
        cachedCwd = rawMethods.cwd();
                             ^
    
    Error: ENOENT: no such file or directory, uv_cwd
        at process.wrappedCwd [as cwd] (node:internal/bootstrap/switches/does_own_process_state:126:28)
        at t.find (/opt/Hyper/resources/bin/cli.js:2:152432)
        at e.exports (/opt/Hyper/resources/bin/cli.js:2:151343)
        at i (/opt/Hyper/resources/bin/cli.js:2:150626)
        at Module.<anonymous> (/opt/Hyper/resources/bin/cli.js:2:148380)
        at r (/opt/Hyper/resources/bin/cli.js:2:614310)
        at /opt/Hyper/resources/bin/cli.js:2:614977
        at /opt/Hyper/resources/bin/cli.js:2:618469
        at Object.<anonymous> (/opt/Hyper/resources/bin/cli.js:2:618473)
        at Module._compile (node:internal/modules/cjs/loader:1120:14) {
      errno: -2,
      code: 'ENOENT',
      syscall: 'uv_cwd'
    }
    
  • The same issue is not observed in gnome terminal.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the missing-CWD steps with preserveCWD enabled, then inspect the bundled /opt/Hyper/resources/bin/cli.js entry point and the surrounding current-working-directory handling. Done means opening a new tab falls back to an existing ancestor or another defined recovery path instead of rapidly emitting errors and closing.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js
Domain
cli, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.