Skip to content

Commit

Permalink
Merge pull request #27 from adinhodovic/improve-exits
Browse files Browse the repository at this point in the history
fix: Improve exiting the terminal
  • Loading branch information
adinhodovic committed Feb 29, 2024
2 parents 13e5b2d + 9a33154 commit f6e3332
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions django_admin_shellx/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import re
import select
import shutil
import signal
import struct
import subprocess
import termios
Expand Down Expand Up @@ -124,15 +125,12 @@ def write_to_pty(self, message):

def kill_pty(self):
if self.subprocess is not None:
self.subprocess.kill()
os.killpg(os.getpgid(self.child_pid), signal.SIGTERM)
self.subprocess = None
self.child_pid = None

def disconnect(self, code):
if self.subprocess is not None:
self.subprocess.kill()
self.subprocess = None
self.child_pid = None
self.kill_pty()

def map_terminal_prompt(self, terminal_prompt):

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "django-admin-shellx"
version = "0.2.4"
version = "0.2.5"
description = "A Django Admin Shell"
authors = ["Adin Hodovic <hodovicadin@gmail.com>"]
license = "MIT"
Expand Down

0 comments on commit f6e3332

Please sign in to comment.