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

File action fails when project folder name has space in it. #171

Closed
abbasegbeyemi opened this issue Nov 20, 2020 · 1 comment
Closed

File action fails when project folder name has space in it. #171

abbasegbeyemi opened this issue Nov 20, 2020 · 1 comment
Assignees

Comments

@abbasegbeyemi
Copy link
Contributor

Check Troubleshooting first

Describe the bug
Opening a project folder with the file action feature fails and does not open PyCharm. Screen shots are included. It appears not to be parsing filenames with spaces correctly.

To Reproduce
Steps to reproduce the behavior:

  1. Create a folder with a space in the folder name eg "Test Project"
  2. Run Alfred, navigate to the folder and select the Open in PyCharm file action.
  3. If PyCharm is already running, the running window shows the error saying it cant open the folder.
  4. If PyCharm is not running, it freezes and you have to force quit PyCharm. The notification then shows the error.

Debug Output

[18:54:07.135] JetBrains - Open Project - v3[File Action] Processing complete
[18:54:07.167] JetBrains - Open Project - v3[File Action] Passing output '/Users/abbasegbeyemi/Desktop/Test Project' to Run Script
[18:54:07.786] JetBrains - Open Project - v3[Run Script] Processing complete
[18:54:07.803] JetBrains - Open Project - v3[Run Script] Passing output '{
  uid: 'Test Project',
  title: 'Test Project',
  match: 'Test Project',
  subtitle: '/Users/abbasegbeyemi/Desktop/Test Project',
  arg: '/Users/abbasegbeyemi/Desktop/Test Project',
  autocomplete: 'Test Project',
  text: {
    copy: '/Users/abbasegbeyemi/Desktop/Test Project',
    largetype: 'Test Project'
  },
  icon: { path: '/Applications/PyCharm.app', type: 'fileicon' },
  variables: {
    jb_project_name: 'Test Project',
    jb_bin: '/usr/local/bin/charm',
    jb_search_basename: 'Test Project'
  }
}
' to Run Script
[18:55:06.755] JetBrains - Open Project - v3[Run Script] Processing complete
[18:55:06.763] JetBrains - Open Project - v3[Run Script] Passing output 'Cannot find file '/Users/abbasegbeyemi/Desktop/Test'
  Test  Project
' to Post Notification

Things seem to be going wrong in the second script.

Expected behavior
Selecting open in PyCharm should open the file in PyCharm as long as the file has a system permitted filename.

Screenshots
Screenshot 2020-11-20 at 18 55 21
Screenshot 2020-11-20 at 19 01 55
Screenshot 2020-11-20 at 19 01 35

Q A
Workflow version 1.4.1
OSX Version 11.0.1
Alfred Version 4.2.1
JetBrains Product/Version PyCharm / 2020.2
Installation type _classic .dmg
Node version 14.8.0 (node --version)
NPM version 6.14.8 (npm --version)

Additional context
It works perfectly fine if the folder name does not have a space in it. So maybe this bug is not that big of a deal.

I'm not very familiar with sh, and I have just installed Alfred for the first time today. But I will take a crack at fixing the issue and maybe submit a pull request if I can.

abbasegbeyemi added a commit to abbasegbeyemi/alfred-jetbrains that referenced this issue Nov 21, 2020
When using a file action to open a project path which contains a space in it. The pycharm cannot open it because spaces in paths are not properly escaped.

This fix uses sed to properly escape spaces in file paths.
abbasegbeyemi added a commit to abbasegbeyemi/alfred-jetbrains that referenced this issue Nov 21, 2020
Changed <= back to &lt;=
bchatard pushed a commit that referenced this issue Dec 2, 2020
* REF: ISSUE #171

When using a file action to open a project path which contains a space in it. The pycharm cannot open it because spaces in paths are not properly escaped.

This fix uses sed to properly escape spaces in file paths.

* REF: ISSUE #171
Changed <= back to &lt;=
@bchatard
Copy link
Owner

bchatard commented Dec 2, 2020

please bump to version 1.4.3 and enjoy your work ;)

thanks again for your contribution

@bchatard bchatard closed this as completed Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants