ppicker 0.1.0__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. ppicker-0.3.0/.github/workflows/crates.yml +23 -0
  2. {ppicker-0.1.0 → ppicker-0.3.0}/Cargo.lock +11 -1
  3. {ppicker-0.1.0 → ppicker-0.3.0}/Cargo.toml +2 -1
  4. {ppicker-0.1.0 → ppicker-0.3.0}/PKG-INFO +95 -8
  5. {ppicker-0.1.0 → ppicker-0.3.0}/README.md +94 -7
  6. ppicker-0.3.0/assets/07-workspace.png +0 -0
  7. ppicker-0.3.0/assets/08-workspace-open-with.png +0 -0
  8. ppicker-0.3.0/assets/09-stay-open.png +0 -0
  9. ppicker-0.3.0/assets/hero.png +0 -0
  10. {ppicker-0.1.0 → ppicker-0.3.0}/docs/MIGRATION.md +9 -1
  11. {ppicker-0.1.0 → ppicker-0.3.0}/e2e/scenario.sh +53 -2
  12. ppicker-0.3.0/src/editors.rs +401 -0
  13. ppicker-0.3.0/src/exec.rs +66 -0
  14. {ppicker-0.1.0 → ppicker-0.3.0}/src/main.rs +130 -34
  15. {ppicker-0.1.0 → ppicker-0.3.0}/src/store.rs +179 -19
  16. {ppicker-0.1.0 → ppicker-0.3.0}/src/tui.rs +491 -122
  17. ppicker-0.1.0/assets/hero.png +0 -0
  18. ppicker-0.1.0/src/exec.rs +0 -49
  19. {ppicker-0.1.0 → ppicker-0.3.0}/.gitattributes +0 -0
  20. {ppicker-0.1.0 → ppicker-0.3.0}/.github/workflows/ci.yml +0 -0
  21. {ppicker-0.1.0 → ppicker-0.3.0}/.github/workflows/release.yml +0 -0
  22. {ppicker-0.1.0 → ppicker-0.3.0}/.gitignore +0 -0
  23. {ppicker-0.1.0 → ppicker-0.3.0}/assets/01-search.png +0 -0
  24. {ppicker-0.1.0 → ppicker-0.3.0}/assets/02-open-with.png +0 -0
  25. {ppicker-0.1.0 → ppicker-0.3.0}/assets/03-remembered.png +0 -0
  26. {ppicker-0.1.0 → ppicker-0.3.0}/assets/04-switch-editor.png +0 -0
  27. {ppicker-0.1.0 → ppicker-0.3.0}/assets/05-rofi-project.png +0 -0
  28. {ppicker-0.1.0 → ppicker-0.3.0}/assets/06-rofi-editor.png +0 -0
  29. {ppicker-0.1.0 → ppicker-0.3.0}/e2e/Dockerfile +0 -0
  30. {ppicker-0.1.0 → ppicker-0.3.0}/e2e/Dockerfile.dockerignore +0 -0
  31. {ppicker-0.1.0 → ppicker-0.3.0}/e2e/README.md +0 -0
  32. {ppicker-0.1.0 → ppicker-0.3.0}/e2e/i3config +0 -0
  33. {ppicker-0.1.0 → ppicker-0.3.0}/pyproject.toml +0 -0
  34. {ppicker-0.1.0 → ppicker-0.3.0}/src/menu.rs +0 -0
@@ -0,0 +1,23 @@
1
+ name: Publish to crates.io
2
+ on:
3
+ push:
4
+ tags: ["v*"]
5
+ workflow_dispatch:
6
+ inputs:
7
+ ref:
8
+ description: Tag to publish
9
+ default: v0.1.0
10
+
11
+ jobs:
12
+ crates:
13
+ runs-on: ubuntu-latest
14
+ # The CRATE_IO secret lives in the `pypi` environment.
15
+ environment: pypi
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ with:
19
+ ref: ${{ inputs.ref || github.ref }}
20
+ - uses: dtolnay/rust-toolchain@stable
21
+ - run: cargo publish --locked
22
+ env:
23
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CRATE_IO }}
@@ -1097,7 +1097,7 @@ checksum = "4a6394b9e965e73d0a289ee54f589087e2c676aedf60885baf52c76b771e4958"
1097
1097
 
1098
1098
  [[package]]
1099
1099
  name = "ppicker"
1100
- version = "0.1.0"
1100
+ version = "0.3.0"
1101
1101
  dependencies = [
1102
1102
  "anyhow",
1103
1103
  "clap",
@@ -1106,6 +1106,7 @@ dependencies = [
1106
1106
  "ratatui",
1107
1107
  "serde",
1108
1108
  "toml",
1109
+ "which",
1109
1110
  ]
1110
1111
 
1111
1112
  [[package]]
@@ -1923,6 +1924,15 @@ dependencies = [
1923
1924
  "wezterm-dynamic",
1924
1925
  ]
1925
1926
 
1927
+ [[package]]
1928
+ name = "which"
1929
+ version = "8.0.6"
1930
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1931
+ checksum = "bae2f2b2b816647a1cab1acc91f5bd20812d53cb344382635ec2181940c8034f"
1932
+ dependencies = [
1933
+ "libc",
1934
+ ]
1935
+
1926
1936
  [[package]]
1927
1937
  name = "winapi"
1928
1938
  version = "0.3.9"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "ppicker"
3
- version = "0.1.0"
3
+ version = "0.3.0"
4
4
  edition = "2024"
5
5
  description = "Fast project picker for tiling window managers: open a project in your editor"
6
6
  license = "MIT"
@@ -19,6 +19,7 @@ nucleo-matcher = "0.3.1"
19
19
  ratatui = "0.30.2"
20
20
  serde = { version = "1.0.229", features = ["derive"] }
21
21
  toml = "1.2.1"
22
+ which = "8.0.6"
22
23
 
23
24
  [profile.release]
24
25
  opt-level = "z"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ppicker
3
- Version: 0.1.0
3
+ Version: 0.3.0
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Environment :: Console
6
6
  Classifier: Programming Language :: Rust
@@ -72,6 +72,19 @@ editor will be used, when you last opened it, and its tags. Press `Tab` to filte
72
72
  Press **Enter**. The project opens in its editor and ppicker closes. The editor is started in
73
73
  the project's folder and keeps running on its own, so closing the terminal does not close it.
74
74
 
75
+ ### Open several projects at once
76
+
77
+ Press **Ctrl-o** instead of Enter. The project opens just the same, but ppicker **stays open**, so
78
+ you can go straight on to the next one: type, `Ctrl-o`, type, `Ctrl-o`, then `Esc` when you are
79
+ done. A line at the bottom confirms each one (`opened web-ui in pycharm`), and the list updates
80
+ the editor and "last used" time as you go.
81
+
82
+ ![Two projects opened in one session; the picker is still open](https://raw.githubusercontent.com/roman-right/ppicker/main/assets/09-stay-open.png)
83
+
84
+ Prefer it the other way round? Set `keep_open = true` in the config: then `Enter` opens and stays,
85
+ and `Ctrl-o` opens and quits. If an editor cannot be started (say, its command is not installed),
86
+ ppicker stays open and shows the error instead of closing.
87
+
75
88
  The first time you open a project, it uses your default editor, the first one in your config
76
89
  (see [Editors](https://github.com/roman-right/ppicker#editors)). After that it uses whichever editor you opened it with last.
77
90
 
@@ -102,6 +115,31 @@ default.
102
115
 
103
116
  ![Switching a project's editor with Ctrl-e](https://raw.githubusercontent.com/roman-right/ppicker/main/assets/04-switch-editor.png)
104
117
 
118
+ ### Workspaces, not just folders
119
+
120
+ A project does not have to be a folder. You can add a **workspace file** too, and ppicker opens it
121
+ the way the editor expects:
122
+
123
+ ```shell
124
+ pp add ~/work/shop.code-workspace # a VS Code workspace
125
+ pp add ~/work/site.sublime-project # a Sublime Text project
126
+ pp scan ~/work --workspaces # also pick up workspace files while scanning
127
+ ```
128
+
129
+ A workspace is named after its file (`Shop Front`) and marked with `◇` in the list; the details
130
+ panel says what kind it is.
131
+
132
+ ![A VS Code workspace in the list](https://raw.githubusercontent.com/roman-right/ppicker/main/assets/07-workspace.png)
133
+
134
+ A `.code-workspace` file means something only to VS Code, so ppicker offers only editors that can
135
+ open it. `Enter` uses the first VS Code editor in your `ides`, `→` lists just those (below, `code`
136
+ only: vim and PyCharm are left out), and `Ctrl-e` cycles only through them.
137
+
138
+ ![Only editors that can open a workspace are offered](https://raw.githubusercontent.com/roman-right/ppicker/main/assets/08-workspace-open-with.png)
139
+
140
+ If none of your editors can open it, ppicker says which one to add instead of failing silently.
141
+ A folder and a workspace file are separate entries, so one repository can appear as both.
142
+
105
143
  ### Use rofi, wofi or fuzzel instead
106
144
 
107
145
  If you already have a launcher you like, use it for the picking:
@@ -130,7 +168,8 @@ For other launchers, pass the command to use: `pp menu --cmd "fuzzel --dmenu"` (
130
168
  |---|---|
131
169
  | type | search by name or path |
132
170
  | `↑` `↓` (or `Ctrl-p` `Ctrl-n`) | move through the list |
133
- | `Enter` | open the project in its editor |
171
+ | `Enter` | open the project in its editor, then close |
172
+ | `Ctrl-o` | open the project and **keep the picker open** (to open several) |
134
173
  | `→` | open with a different editor |
135
174
  | `1`-`9` | in the editor list, open with that editor |
136
175
  | `Ctrl-e` | switch the project's editor without opening it |
@@ -138,22 +177,65 @@ For other launchers, pass the command to use: `pp menu --cmd "fuzzel --dmenu"` (
138
177
  | `Ctrl-u` | clear the search |
139
178
  | `←` or `Esc` | back from the editor list; `Esc` in the main list quits |
140
179
 
180
+ The `Ctrl` shortcuts also work when a Russian keyboard layout is active (`Ctrl-щ` is `Ctrl-o`).
181
+ With `keep_open = true` in the config, `Enter` and `Ctrl-o` swap roles.
182
+
141
183
  ## Editors
142
184
 
143
185
  List the editors you use in the config file (run `pp paths` to see where it is). The first one is
144
186
  the default for projects you have not opened yet:
145
187
 
146
188
  ```toml
147
- ides = ["code", "pycharm", "vim"]
189
+ ides = ["vscode", "pycharm", "zed"]
148
190
  scan_dirs = ["/home/me/code"] # used by `pp scan` when you give no folder
191
+ keep_open = false # true: Enter opens and stays open, Ctrl-o opens and quits
149
192
  ```
150
193
 
151
- An editor is just a command. ppicker runs `<command> .` inside the project folder, for example
152
- `code .` or `pycharm .`. Anything that opens a folder works, including `idea`, `zed`, `subl`,
153
- `nvim` (see the note below for terminal editors) or `code -n`.
194
+ Each entry is either a **name** ppicker knows, or a plain **command**.
195
+
196
+ ### Names: the same editor on every system
197
+
198
+ Editor commands are called different things on different systems: `code` on Linux, `code.cmd` on
199
+ Windows, `codium`, a flatpak... A name stands for a list of commands, and ppicker runs the first
200
+ one it finds on your `PATH`. So the same config works everywhere:
201
+
202
+ | Name | Tries, in order |
203
+ |---|---|
204
+ | `vscode` | `code`, `code-insiders`, `codium`, `vscodium`, the VS Code flatpak |
205
+ | `pycharm` | `pycharm`, `pycharm-professional`, `pycharm-community`, `charm`, `pycharm64`, the PyCharm flatpaks |
206
+ | `idea`, `webstorm`, `goland`, `rustrover`, `clion`, `phpstorm`, `rider`, `rubymine` | the usual launcher name of each (and its `64` variant) |
207
+ | `sublime` | `subl`, `sublime_text`, `sublime-text` |
208
+ | `zed` | `zed`, `zeditor` |
209
+ | `cursor`, `windsurf` | the same name |
210
+
211
+ If a name is not found you get an error that lists what was tried.
212
+
213
+ ### Plain commands
214
+
215
+ Anything else is run as written, for example `code`, `idea`, `code -n` or `alacritty -e nvim`.
216
+ Put a path with spaces in quotes: `"C:\Program Files\Some Editor\editor.exe"`. ppicker recognises
217
+ the well-known commands (`code`, `codium`, `cursor`, `subl`, `pycharm`, ...) so it knows which
218
+ projects they can open.
219
+
220
+ ### Your own command list
221
+
222
+ If your install is somewhere unusual, or you want a different order, override a name (or define a
223
+ new one) in `config.toml`. The first command that exists is used:
224
+
225
+ ```toml
226
+ [commands]
227
+ vscode = ['C:\Tools\VSCode\bin\code.cmd', "code"] # my install first, then whatever is on PATH
228
+ work = ["codium", "code"] # a new name, usable in `ides`
229
+ ```
230
+
231
+ ### How a project is opened
232
+
233
+ A folder is opened as `<editor> .` from inside the folder. A workspace file is opened as
234
+ `<editor> <file>` (see [Workspaces](https://github.com/roman-right/ppicker#workspaces-not-just-folders)). The editor is started detached,
235
+ so it keeps running after ppicker exits.
154
236
 
155
237
  > **Terminal editors** such as vim or nvim need a terminal to run in. Use a command that starts
156
- > one, for example `ides = ["code", "alacritty -e nvim"]`.
238
+ > one, for example `ides = ["vscode", "alacritty -e nvim"]`.
157
239
 
158
240
  ## Commands
159
241
 
@@ -168,8 +250,10 @@ pp editor myproj pycharm # set it without opening
168
250
  pp editor myproj --reset # forget it, back to the default editor
169
251
  pp add . --ide pycharm # register the current folder and set its editor
170
252
  pp add . --name api -t work # custom name, add a tag (repeat -t for more)
253
+ pp add ~/w/shop.code-workspace # add a workspace file instead of a folder
171
254
  pp scan ~/code -t work # add every git repository in a folder
172
- pp list # show projects with their editors
255
+ pp scan ~/code --workspaces # ...and the workspace files in it (one level down)
256
+ pp list # show projects with their editors (workspaces marked ◇)
173
257
  pp rm myproj # remove from the list (files are untouched)
174
258
  pp menu [--ask] # pick through rofi or another launcher
175
259
  pp paths # where the config and project list are stored
@@ -201,6 +285,9 @@ Two small text files you can read and edit; `pp paths` prints the exact location
201
285
  - `config.toml`: your settings (editors, scan folders).
202
286
  - `projects.toml`: your projects, their tags, last-opened time and remembered editor.
203
287
 
288
+ To keep both somewhere else (a portable install, or to try things out without touching your
289
+ real list), set `PPICKER_HOME` to a folder; ppicker then uses `config/` and `data/` inside it.
290
+
204
291
  ## Moving from `code-compass`
205
292
 
206
293
  ppicker replaces the old Qt-based `code-compass` package. See [docs/MIGRATION.md](https://github.com/roman-right/ppicker/blob/main/docs/MIGRATION.md)
@@ -57,6 +57,19 @@ editor will be used, when you last opened it, and its tags. Press `Tab` to filte
57
57
  Press **Enter**. The project opens in its editor and ppicker closes. The editor is started in
58
58
  the project's folder and keeps running on its own, so closing the terminal does not close it.
59
59
 
60
+ ### Open several projects at once
61
+
62
+ Press **Ctrl-o** instead of Enter. The project opens just the same, but ppicker **stays open**, so
63
+ you can go straight on to the next one: type, `Ctrl-o`, type, `Ctrl-o`, then `Esc` when you are
64
+ done. A line at the bottom confirms each one (`opened web-ui in pycharm`), and the list updates
65
+ the editor and "last used" time as you go.
66
+
67
+ ![Two projects opened in one session; the picker is still open](https://raw.githubusercontent.com/roman-right/ppicker/main/assets/09-stay-open.png)
68
+
69
+ Prefer it the other way round? Set `keep_open = true` in the config: then `Enter` opens and stays,
70
+ and `Ctrl-o` opens and quits. If an editor cannot be started (say, its command is not installed),
71
+ ppicker stays open and shows the error instead of closing.
72
+
60
73
  The first time you open a project, it uses your default editor, the first one in your config
61
74
  (see [Editors](https://github.com/roman-right/ppicker#editors)). After that it uses whichever editor you opened it with last.
62
75
 
@@ -87,6 +100,31 @@ default.
87
100
 
88
101
  ![Switching a project's editor with Ctrl-e](https://raw.githubusercontent.com/roman-right/ppicker/main/assets/04-switch-editor.png)
89
102
 
103
+ ### Workspaces, not just folders
104
+
105
+ A project does not have to be a folder. You can add a **workspace file** too, and ppicker opens it
106
+ the way the editor expects:
107
+
108
+ ```shell
109
+ pp add ~/work/shop.code-workspace # a VS Code workspace
110
+ pp add ~/work/site.sublime-project # a Sublime Text project
111
+ pp scan ~/work --workspaces # also pick up workspace files while scanning
112
+ ```
113
+
114
+ A workspace is named after its file (`Shop Front`) and marked with `◇` in the list; the details
115
+ panel says what kind it is.
116
+
117
+ ![A VS Code workspace in the list](https://raw.githubusercontent.com/roman-right/ppicker/main/assets/07-workspace.png)
118
+
119
+ A `.code-workspace` file means something only to VS Code, so ppicker offers only editors that can
120
+ open it. `Enter` uses the first VS Code editor in your `ides`, `→` lists just those (below, `code`
121
+ only: vim and PyCharm are left out), and `Ctrl-e` cycles only through them.
122
+
123
+ ![Only editors that can open a workspace are offered](https://raw.githubusercontent.com/roman-right/ppicker/main/assets/08-workspace-open-with.png)
124
+
125
+ If none of your editors can open it, ppicker says which one to add instead of failing silently.
126
+ A folder and a workspace file are separate entries, so one repository can appear as both.
127
+
90
128
  ### Use rofi, wofi or fuzzel instead
91
129
 
92
130
  If you already have a launcher you like, use it for the picking:
@@ -115,7 +153,8 @@ For other launchers, pass the command to use: `pp menu --cmd "fuzzel --dmenu"` (
115
153
  |---|---|
116
154
  | type | search by name or path |
117
155
  | `↑` `↓` (or `Ctrl-p` `Ctrl-n`) | move through the list |
118
- | `Enter` | open the project in its editor |
156
+ | `Enter` | open the project in its editor, then close |
157
+ | `Ctrl-o` | open the project and **keep the picker open** (to open several) |
119
158
  | `→` | open with a different editor |
120
159
  | `1`-`9` | in the editor list, open with that editor |
121
160
  | `Ctrl-e` | switch the project's editor without opening it |
@@ -123,22 +162,65 @@ For other launchers, pass the command to use: `pp menu --cmd "fuzzel --dmenu"` (
123
162
  | `Ctrl-u` | clear the search |
124
163
  | `←` or `Esc` | back from the editor list; `Esc` in the main list quits |
125
164
 
165
+ The `Ctrl` shortcuts also work when a Russian keyboard layout is active (`Ctrl-щ` is `Ctrl-o`).
166
+ With `keep_open = true` in the config, `Enter` and `Ctrl-o` swap roles.
167
+
126
168
  ## Editors
127
169
 
128
170
  List the editors you use in the config file (run `pp paths` to see where it is). The first one is
129
171
  the default for projects you have not opened yet:
130
172
 
131
173
  ```toml
132
- ides = ["code", "pycharm", "vim"]
174
+ ides = ["vscode", "pycharm", "zed"]
133
175
  scan_dirs = ["/home/me/code"] # used by `pp scan` when you give no folder
176
+ keep_open = false # true: Enter opens and stays open, Ctrl-o opens and quits
134
177
  ```
135
178
 
136
- An editor is just a command. ppicker runs `<command> .` inside the project folder, for example
137
- `code .` or `pycharm .`. Anything that opens a folder works, including `idea`, `zed`, `subl`,
138
- `nvim` (see the note below for terminal editors) or `code -n`.
179
+ Each entry is either a **name** ppicker knows, or a plain **command**.
180
+
181
+ ### Names: the same editor on every system
182
+
183
+ Editor commands are called different things on different systems: `code` on Linux, `code.cmd` on
184
+ Windows, `codium`, a flatpak... A name stands for a list of commands, and ppicker runs the first
185
+ one it finds on your `PATH`. So the same config works everywhere:
186
+
187
+ | Name | Tries, in order |
188
+ |---|---|
189
+ | `vscode` | `code`, `code-insiders`, `codium`, `vscodium`, the VS Code flatpak |
190
+ | `pycharm` | `pycharm`, `pycharm-professional`, `pycharm-community`, `charm`, `pycharm64`, the PyCharm flatpaks |
191
+ | `idea`, `webstorm`, `goland`, `rustrover`, `clion`, `phpstorm`, `rider`, `rubymine` | the usual launcher name of each (and its `64` variant) |
192
+ | `sublime` | `subl`, `sublime_text`, `sublime-text` |
193
+ | `zed` | `zed`, `zeditor` |
194
+ | `cursor`, `windsurf` | the same name |
195
+
196
+ If a name is not found you get an error that lists what was tried.
197
+
198
+ ### Plain commands
199
+
200
+ Anything else is run as written, for example `code`, `idea`, `code -n` or `alacritty -e nvim`.
201
+ Put a path with spaces in quotes: `"C:\Program Files\Some Editor\editor.exe"`. ppicker recognises
202
+ the well-known commands (`code`, `codium`, `cursor`, `subl`, `pycharm`, ...) so it knows which
203
+ projects they can open.
204
+
205
+ ### Your own command list
206
+
207
+ If your install is somewhere unusual, or you want a different order, override a name (or define a
208
+ new one) in `config.toml`. The first command that exists is used:
209
+
210
+ ```toml
211
+ [commands]
212
+ vscode = ['C:\Tools\VSCode\bin\code.cmd', "code"] # my install first, then whatever is on PATH
213
+ work = ["codium", "code"] # a new name, usable in `ides`
214
+ ```
215
+
216
+ ### How a project is opened
217
+
218
+ A folder is opened as `<editor> .` from inside the folder. A workspace file is opened as
219
+ `<editor> <file>` (see [Workspaces](https://github.com/roman-right/ppicker#workspaces-not-just-folders)). The editor is started detached,
220
+ so it keeps running after ppicker exits.
139
221
 
140
222
  > **Terminal editors** such as vim or nvim need a terminal to run in. Use a command that starts
141
- > one, for example `ides = ["code", "alacritty -e nvim"]`.
223
+ > one, for example `ides = ["vscode", "alacritty -e nvim"]`.
142
224
 
143
225
  ## Commands
144
226
 
@@ -153,8 +235,10 @@ pp editor myproj pycharm # set it without opening
153
235
  pp editor myproj --reset # forget it, back to the default editor
154
236
  pp add . --ide pycharm # register the current folder and set its editor
155
237
  pp add . --name api -t work # custom name, add a tag (repeat -t for more)
238
+ pp add ~/w/shop.code-workspace # add a workspace file instead of a folder
156
239
  pp scan ~/code -t work # add every git repository in a folder
157
- pp list # show projects with their editors
240
+ pp scan ~/code --workspaces # ...and the workspace files in it (one level down)
241
+ pp list # show projects with their editors (workspaces marked ◇)
158
242
  pp rm myproj # remove from the list (files are untouched)
159
243
  pp menu [--ask] # pick through rofi or another launcher
160
244
  pp paths # where the config and project list are stored
@@ -186,6 +270,9 @@ Two small text files you can read and edit; `pp paths` prints the exact location
186
270
  - `config.toml`: your settings (editors, scan folders).
187
271
  - `projects.toml`: your projects, their tags, last-opened time and remembered editor.
188
272
 
273
+ To keep both somewhere else (a portable install, or to try things out without touching your
274
+ real list), set `PPICKER_HOME` to a folder; ppicker then uses `config/` and `data/` inside it.
275
+
189
276
  ## Moving from `code-compass`
190
277
 
191
278
  ppicker replaces the old Qt-based `code-compass` package. See [docs/MIGRATION.md](https://github.com/roman-right/ppicker/blob/main/docs/MIGRATION.md)
Binary file
Binary file
Binary file
@@ -9,7 +9,8 @@ what you need to do, and how to bring your projects with you.
9
9
  1. **`ppicker` is released** on PyPI and crates.io. Its command is `pp`.
10
10
  2. **`code-compass` 0.2.0 is released** as a final version. It still works, but prints a notice
11
11
  when you start it and adds a `migrate` command that copies your projects to ppicker.
12
- 3. **A migration period of at least 8 weeks** follows the 0.2.0 release.
12
+ 3. **A short migration period of about two weeks** follows the 0.2.0 release (until late
13
+ November 2026).
13
14
  4. **After that, the `code-compass` name on PyPI is handed over to a different, unrelated
14
15
  project.** Old `code-compass` releases may be removed from PyPI at that point.
15
16
 
@@ -34,6 +35,13 @@ pipx install ppicker # or: uv tool install ppicker
34
35
  pipx run code-compass==0.2.0 migrate
35
36
  ```
36
37
 
38
+ If the name on PyPI has already been handed over, install the final release straight from
39
+ GitHub instead; it is the same code:
40
+
41
+ ```shell
42
+ pipx run --spec git+https://github.com/roman-right/ppicker@code-compass-v0.2.0 code-compass migrate
43
+ ```
44
+
37
45
  This reads `~/.config/code_compass/data.db` and adds every project to ppicker. If `pp` is on your
38
46
  PATH it imports directly; otherwise it writes `ppicker-import.toml` and tells you to run
39
47
  `pp import ppicker-import.toml`. Running it twice is harmless: projects are matched by path, so
@@ -13,9 +13,9 @@ sleep 2
13
13
 
14
14
  # Fake editors that record where they were started, to prove the detached launch.
15
15
  for ed in code pycharm vim; do
16
- printf '#!/bin/sh\npwd > /tmp/%s_called\n' "$ed" > /usr/local/bin/$ed && chmod +x /usr/local/bin/$ed
16
+ printf '#!/bin/sh\npwd > /tmp/%s_called\nprintf "%%s\\n" "$@" > /tmp/%s_args\n' "$ed" "$ed" > /usr/local/bin/$ed && chmod +x /usr/local/bin/$ed
17
17
  done
18
- reset_calls() { rm -f /tmp/code_called /tmp/pycharm_called /tmp/vim_called; }
18
+ reset_calls() { rm -f /tmp/code_called /tmp/pycharm_called /tmp/vim_called /tmp/codium_called /tmp/*_args; }
19
19
 
20
20
  # Fake projects.
21
21
  mkdir -p ~/code && cd ~/code
@@ -88,6 +88,57 @@ sleep 1
88
88
  check "pp open uses the editor given at add time (vim)" "[ \"\$(called vim)\" = /root/code/dotfiles ]"
89
89
  $PP list
90
90
 
91
+ echo "=== 7. workspaces: a .code-workspace file (with a space in its path) is a project too ==="
92
+ mkdir -p "$HOME/code/my work"
93
+ WS="$HOME/code/my work/Shop Front.code-workspace"
94
+ printf '{"folders":[{"path":"."}]}' > "$WS"
95
+ printf 'not a project' > "$HOME/code/plain.txt"
96
+ $PP add "$WS" -t work
97
+ check "workspace listed as a workspace, named after the file" "$PP list --plain | grep -q '^Shop Front.*workspace$'"
98
+ check "a plain file is rejected" "! $PP add \$HOME/code/plain.txt >/dev/null 2>&1"
99
+ check "pycharm is refused for a workspace" "! $PP open 'Shop Front' pycharm >/dev/null 2>&1"
100
+ reset_calls
101
+ popup
102
+ xdotool type --delay 120 "shop"; sleep 1
103
+ shot 7-workspace # marked with a diamond, "type VS Code workspace", editor = code
104
+ xdotool key Right; sleep 1
105
+ shot 8-workspace-open-with # only editors that can open it
106
+ xdotool key Return; sleep 2
107
+ check "workspace opened by code from its own folder" "[ \"\$(called code)\" = '/root/code/my work' ]"
108
+ check "workspace file passed whole, spaces intact" "[ \"\$(cat /tmp/code_args)\" = '$WS' ]"
109
+ pkill alacritty 2>/dev/null; sleep 1
110
+
111
+ echo "--- 'vscode' finds whichever VS Code command exists (here only codium)"
112
+ reset_calls
113
+ mv /usr/local/bin/code /tmp/code.real
114
+ printf '#!/bin/sh\npwd > /tmp/codium_called\n' > /usr/local/bin/codium && chmod +x /usr/local/bin/codium
115
+ printf 'ides = ["vscode"]\n' > ~/.config/ppicker/config.toml
116
+ $PP editor "Shop Front" --reset >/dev/null # it remembered the literal `code` from above
117
+ $PP open "Shop Front"; sleep 1
118
+ check "vscode resolved to codium" "[ \"\$(called codium)\" = '/root/code/my work' ]"
119
+ mv /tmp/code.real /usr/local/bin/code; rm -f /usr/local/bin/codium
120
+ printf 'ides = ["pycharm", "vim"]\n' > ~/.config/ppicker/config.toml
121
+ $PP editor "Shop Front" --reset >/dev/null
122
+ check "no editor can open it: error says what to add" "$PP open 'Shop Front' 2>&1 | grep -q 'VS Code.*vscode'"
123
+ printf 'ides = ["code", "pycharm", "vim"]\n' > ~/.config/ppicker/config.toml
124
+
125
+ echo "=== 8. Ctrl-O opens several projects without closing the picker ==="
126
+ reset_calls
127
+ popup
128
+ xdotool type --delay 120 "api"; sleep 1
129
+ xdotool key ctrl+o; sleep 1.5
130
+ check "picker is still open after Ctrl-O" "pgrep -x pp >/dev/null"
131
+ check "first project opened (api-server, in code)" "[ \"\$(called code)\" = /root/code/api-server ]"
132
+ xdotool key ctrl+u; sleep 0.3
133
+ xdotool type --delay 120 "web"; sleep 1
134
+ xdotool key ctrl+o; sleep 1.5
135
+ shot 9-stay-open # status line: "opened web-ui in pycharm"
136
+ check "second project opened too (web-ui, in pycharm)" "[ \"\$(called pycharm)\" = /root/code/web-ui ]"
137
+ check "picker still open after the second" "pgrep -x pp >/dev/null"
138
+ xdotool key Escape; sleep 1.2
139
+ check "Esc then closes it" "! pgrep -x pp >/dev/null"
140
+ pkill alacritty 2>/dev/null; sleep 1
141
+
91
142
  echo "=== overview: every project, each with the editor it was last opened in ==="
92
143
  popup
93
144
  shot 0-overview