Skip to content

Commit f80797b

Browse files
committed
fix: Open new terminals in working directory (or $home if no directory opened), add a terminal instance when panel is toggled (active terminal type, otherwise the default configured)
1 parent e6778b4 commit f80797b

File tree

5 files changed

+22
-3
lines changed

5 files changed

+22
-3
lines changed

biscuit/core/components/views/panel/terminal/terminal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def start_service(self, *_) -> None:
6363
self.alive = True
6464
self.last_command = None
6565

66-
self.p = PTY.spawn([self.shell])
66+
self.p = PTY.spawn([self.shell], cwd=self.cwd)
6767
Thread(target=self.write_loop, daemon=True).start()
6868

6969
def destroy(self, *_) -> None:

biscuit/core/components/views/sidebar/extensions/extension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def __init__(self, master, name: str, data: list, *args, **kwargs) -> None:
1616
self.name = name
1717
self.file = os.path.join(self.base.extensionsdir, data[0])
1818
self.author = data[1]
19-
self.description = data[2]
19+
self.description = data[2][:35] + "..." if len(data[2]) > 30 else data[2]
2020
self.url = f"{master.repo_url}extensions/{data[0]}"
2121
self.installed = os.path.isfile(self.file)
2222

biscuit/core/layout/base/content/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ def toggle_panel(self, *_) -> None:
5555
self.editorspane.pack_forget()
5656
else:
5757
self.panel.pack(fill=tk.BOTH, pady=(1, 0))
58+
59+
if not self.panel.terminals.active_terminal:
60+
self.panel.terminals.open_terminal()
5861

5962
self._panel_enabled = not self._panel_enabled
6063

biscuit/core/utils/python_dialog.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import subprocess as sp
23
import webbrowser
34
from tkinter import messagebox
@@ -13,7 +14,10 @@ def show_python_not_installed_message():
1314

1415
def check_python_installation():
1516
try:
16-
sp.check_call(["python", "--version"])
17+
if os.name == "nt":
18+
sp.check_call(["python", "--version"])
19+
else:
20+
sp.check_call(["python3", "--version"])
1721
reqs = sp.check_output(['pip', 'freeze'])
1822

1923
# install python language server

biscuit/core/utils/sysinfo.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ def __init__(self, base: App) -> None:
2727
self.processor = platform.processor()
2828
self.python_version = sys.version
2929
self.tk_version = tk.TclVersion
30+
31+
@property
32+
def is_windows(self) -> bool:
33+
return self.os == "Windows"
34+
35+
@property
36+
def is_linux(self) -> bool:
37+
return self.os == "Linux"
38+
39+
@property
40+
def is_macos(self) -> bool:
41+
return self.os == "Darwin"
3042

3143
def get_current_stats(self) -> str:
3244
"""Get current CPU and Memory usage"""

0 commit comments

Comments
 (0)