vercel / vercel/hyper

[Request] Allow openFile to silently set the directory

Open
#3,200 0 comments 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
  • macOS 10.13.6
  • Hyper.app 2.0.0

Issue

Hello!

I love this app so far, but I have a minor UI gripe I was hoping to help fix if I can. I use a program called cdto to open Hyper with the focused Finder directory as the cwd. When I do this, I get the following:

screen shot 2018-08-30 at 11 48 54 am

This happens when telling Hyper to open a file path, in this case a directory. I was hoping that the duplicate cd stuff at the top could be removed and we would see a clean prompt.

Interestingly, you can do this from the command line with open /Applications/Hyper.app --args ~/Downloads or some other arbitrary path, and it will silently set the cwd, but only when opening Hyper the first time. After that Hyper will do nothing when given that command until the app is closed.

That seems to be the result of the following:

https://github.com/zeit/hyper/blob/6451ba7f85fe5b88268cf4e57da8a1a13f6046b7/app/ui/window.js#L93

If you run open -a "Hyper" ~/Downloads, as cdto effectively does, it will instead run the following:

https://github.com/zeit/hyper/blob/6451ba7f85fe5b88268cf4e57da8a1a13f6046b7/lib/actions/ui.js#L265

which seems to just tell the terminal to run a command to change directories, producing the duplicate output above I was hoping to remove.

So finally, then, my request is this: could you change the second method of opening to a directory so it silently changes as it does with the first method?

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

Read app/ui/window.js around line 93 and lib/actions/ui.js around line 265, then compare the two directory-opening paths described in the issue. The change is done when opening a directory through the second method silently sets the cwd without printing duplicate cd commands, while preserving the existing first-launch behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
desktop
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.