adur1990 / Pass-for-macOS

macOS wrapper for pass, the standard UNIX password manager
BSD 3-Clause "New" or "Revised" License
112 stars 8 forks source link

Does not open #55

Closed nielsk closed 2 years ago

nielsk commented 2 years ago

I installed the app via home brew and it just does not open.

When I start it from the cli from inside the Contents-folder inside the Application-bundle it just does nothing but at least it turns up in Activity Monitor.

Where are settings or other parts stored? Maybe deleting them might help since I had the app installed in the past.

I am on macOS 12.3.1 if I am not mistaken.

adur1990 commented 2 years ago

I'm sorry to hear that it does not work. Can you provide some more information? Please you the issue template:

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

All steps to reproduce the behavior.

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information)

Additional information

Add any other information about the problem here.

nielsk commented 2 years ago

Describe the bug

The application does not open

To Reproduce

I just installed it via Homebrew and tried to start the application

Expected behavior

It opens and works

Desktop (please complete the following information)

macOS version: macOS 12.2.1 Safari version: 15.3 (17612.4.9.1.8) Pass for macOS version: 0.11.4 How was Pass for macOS installed (Github release, built self, ...): Homebew

adur1990 commented 2 years ago

Sorry, but this does not help. What does it mean "does not open"? Do you see any error message? Is the icon appearing in the status bar? Can you load the Safari extension? Do you find anything in the logs (though the console.app)?

How am I supposed to find the problem without any clue?

I am very happy to help, but need more information, any hint.

ErnestDong commented 2 years ago

me too and I found before 0.11.2 it works. No errors, can load extension but just don't launch.

I think it's because we are zsh users. /bin/zsh with -i option in https://github.com/adur1990/Pass-for-macOS/blob/56a826a43514ed36641f9eb135cb0ca4415bd7d6/passformacos/Passwordstore.swift#L23 stucks the following script.

import Foundation
import os.log
let task = Process()
task.launchPath = "/bin/zsh"
task.arguments = ["-i", "-c", "echo $PASSWORD_STORE_DIR"]
let pipe = Pipe()
task.standardOutput = pipe
task.launch()
print("launched")
let data = pipe.fileHandleForReading.readDataToEndOfFile()
print("stucked")
var passwordStoreUrl = URL(string: "test")!
if data.count > 1 {
    var passwordStorePath = NSString(data: data, encoding: String.Encoding.utf8.rawValue)! as String
    passwordStorePath = passwordStorePath.trimmingCharacters(in: .newlines)
    passwordStoreUrl = URL(string: passwordStorePath)!
} else {
    let userHome = ProcessInfo.processInfo.environment["HOME"]!
    passwordStoreUrl = URL(string: "\(userHome)/.password-store")!
}
print(passwordStoreUrl)

What does -i mean is confusing for me. Here's the explanation. But it works without -i.

nielsk commented 2 years ago

Yes, I use zsh

But otherwise: I do not have further information. The icon does not appear, the safari extension does not say that the app is loaded. There is nothing in the console. Even if started on the cli, the app "hangs" after hitting enter, when I use: /Applications/Pass\ for\ macOS.app/Contents/MacOS/Pass\ for\ macOS

ErnestDong commented 2 years ago

after change to fish and reboot, passformacos can run. Hope just drop the -i would not introduce some unexpected bug.

adur1990 commented 2 years ago

Hi,

thank you for the additional information. The -i option forces the called shell to be interactive, so that Pass for macOS can parse the output. Without an interactive shell, the called pass command will not output anything. The strange part is that zsh also supports -i. I will investigate as soon as I can.

adur1990 commented 2 years ago

So, I investigated the error and can not find any issue. The -i option is required to enforce an interactive shell. With an interactive shell, the default rc files are read (like ~/.bashrc or equivalent for other shells), where the $PASSWORD_STORE_DIR variable is defined. Without -i I have no other option to get this variable.

However, in my testing with zsh, I have not figured out any issues. It works on my machine, so I assume that the real problem is somewhere else. I would really appreciate if you could see if there are any logs in console.app. Otherwise I can not help, sorry.

ErnestDong commented 2 years ago

Thanks! I found https://iterm2.com/shell_integration/zsh stops me using passformacos. Sorry for bothering and thanks for your package.

adur1990 commented 2 years ago

I'm closing this issue due to inactivity for now. Please, feel free to open it again.