@naxodev/opencode-music-player 0.5.2 → 0.5.3

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 (2) hide show
  1. package/dist/index.js +3 -14
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -895,25 +895,14 @@ function kittyImageId(key) {
895
895
  }
896
896
  function writeGraphics(renderer, data) {
897
897
  const target = renderer;
898
- if (!target.stdout || typeof target.realStdoutWrite !== "function")
898
+ if (typeof target.writeOut !== "function")
899
899
  return false;
900
+ const commands = typeof data === "string" ? [data] : data;
900
901
  const output = (value) => process.env.TMUX && !process.env.HERDR_ENV ? tmuxPassthrough(value) : value;
901
- let cursorSaved = false;
902
902
  try {
903
- for (const command of typeof data === "string" ? [data] : data) {
904
- if (command.includes("\x1B7"))
905
- cursorSaved = true;
906
- target.realStdoutWrite.call(target.stdout, output(command));
907
- if (command.includes("\x1B8"))
908
- cursorSaved = false;
909
- }
903
+ target.writeOut.call(renderer, commands.map(output).join(""));
910
904
  return true;
911
905
  } catch {
912
- if (cursorSaved) {
913
- try {
914
- target.realStdoutWrite.call(target.stdout, output("\x1B8"));
915
- } catch {}
916
- }
917
906
  return false;
918
907
  }
919
908
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naxodev/opencode-music-player",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "macOS system Now Playing controls for the OpenCode 2 TUI",
5
5
  "license": "MIT",
6
6
  "author": {