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

cd to appears to open 2 windows, is there something I can do? #44

Open
jbtule opened this issue Oct 11, 2019 · 8 comments
Open

cd to appears to open 2 windows, is there something I can do? #44

jbtule opened this issue Oct 11, 2019 · 8 comments

Comments

@jbtule
Copy link
Owner

jbtule commented Oct 11, 2019

Question: "cd to" appears to open 2 windows, is there something I can do?

@jbtule
Copy link
Owner Author

jbtule commented Oct 11, 2019

Answer: Yes. "cd to" isn't actually opening two windows, when the terminal activates, it automatically opens a window if there aren't any open. Before "cd to" became shell agnostic, it used to type "cd ..." into an existing open window, but after it became shell agnostic and would open a new window, but the default window would open first. In "cd to" 3.1 I finally came up with a heuristic to reasonably determine a default window with 99% accuracy in a shell agnostic way, but closing it is not turned on by default.

To turn on auto window closing, on the command line run

defaults write name.tuley.jay.cd-to cdto-close-default-window -bool true

Then it will appear to only open one window in those cases where Terminal.app wants to open a default one.

@ngocbh
Copy link

ngocbh commented Mar 17, 2020

@jbtule It happens again, The above command no longer works. I use the macOS Catalina.

@koishi
Copy link

koishi commented Mar 31, 2020

I had the same problem.
Recently I updated to Catalina
I ran the command that was written, but the problem did not improve.
Later, when I changed from terminal to zsh, this problem did not occur.

@ngocbh
Copy link

ngocbh commented Mar 31, 2020

@koishi I used zsh, too. It worked for the first time. But no longer works when I updated macOS (from Catalina to a new update of Catalina).

@jbtule
Copy link
Owner Author

jbtule commented Mar 31, 2020

I can’t reproduce myself, and there are a lot of different shell configs out there. I can tell you that my heuristic records the number of lines of history the window Cd to opened and checks to see if the other window has the same number of lines of history, and assumes that if it’s the same, then no work has been done in the other window and it can be closed.

@i-am-the-arm
Copy link

I'm noticing this happens if I'm completely quit out of Terminal. If Terminal is running in the background but no sessions/windows open, 'cd to' will open one new Terminal window, otherwise it'll open two. I'm using Fish shell and Catalina if that helps.

@ddaddy
Copy link

ddaddy commented Jan 14, 2021

I'm seeing multiple windows open on Big Sur

Repository owner deleted a comment from atchoo78 Feb 26, 2023
@Angluca
Copy link

Angluca commented Mar 15, 2024

Use BigSur, have 2 window when first open ( ~/ and curpath/ )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants