@lvce-editor/pty-host 8.11.1 → 8.11.2

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.
@@ -1670,7 +1670,8 @@ const toPath = pathOrUri => {
1670
1670
  const create$1 = async ({
1671
1671
  args,
1672
1672
  command,
1673
- cwd
1673
+ cwd,
1674
+ env
1674
1675
  } = {}) => {
1675
1676
  try {
1676
1677
  string(cwd);
@@ -1682,7 +1683,13 @@ const create$1 = async ({
1682
1683
  const cwdPath = toPath(cwd);
1683
1684
  const pty = spawn(command, args, {
1684
1685
  cwd: cwdPath,
1685
- encoding: null
1686
+ encoding: null,
1687
+ ...(env && {
1688
+ env: {
1689
+ ...process.env,
1690
+ ...env
1691
+ }
1692
+ })
1686
1693
  // cols: 10,
1687
1694
  // rows: 10,
1688
1695
  });
@@ -1713,7 +1720,7 @@ const disposeConnection = ipc => {
1713
1720
  };
1714
1721
 
1715
1722
  // TODO maybe merge pty and pty controller
1716
- const createWithDependencies = async (ipc, id, cwd, command, args, createPty) => {
1723
+ const createWithDependencies = async (ipc, id, cwd, command, args, createPty, options = {}) => {
1717
1724
  number(id);
1718
1725
  string(cwd);
1719
1726
  string(command);
@@ -1734,7 +1741,10 @@ const createWithDependencies = async (ipc, id, cwd, command, args, createPty) =>
1734
1741
  pty = await createPty({
1735
1742
  args,
1736
1743
  command,
1737
- cwd
1744
+ cwd,
1745
+ ...(options.env && {
1746
+ env: options.env
1747
+ })
1738
1748
  });
1739
1749
  } catch (error) {
1740
1750
  entries.delete(entry);
@@ -1787,10 +1797,13 @@ const create = (ipc, id, cwd, command, args, options) => {
1787
1797
  return create$2(ipc, id, options.sessionToken, options.restoreOnly === true, () => create$1({
1788
1798
  args,
1789
1799
  command,
1790
- cwd
1800
+ cwd,
1801
+ ...(options.env && {
1802
+ env: options.env
1803
+ })
1791
1804
  }));
1792
1805
  }
1793
- return createWithDependencies(ipc, id, cwd, command, args, create$1);
1806
+ return createWithDependencies(ipc, id, cwd, command, args, create$1, options);
1794
1807
  };
1795
1808
  const write = (ipc, id, data) => {
1796
1809
  const pty = get(ipc, id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/pty-host",
3
- "version": "8.11.1",
3
+ "version": "8.11.2",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "pty-host"