ngpt 3.8.0__py3-none-any.whl → 3.8.1__py3-none-any.whl

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.
ngpt/cli/modes/shell.py CHANGED
@@ -1,5 +1,5 @@
1
1
  from ..formatters import COLORS
2
- from ..ui import spinner, copy_to_clipboard
2
+ from ..ui import spinner, copy_to_clipboard, get_terminal_input
3
3
  from ..renderers import prettify_markdown, has_markdown_renderer, prettify_streaming_markdown, show_available_renderers
4
4
  from ...utils import enhance_prompt_with_web_search, process_piped_input
5
5
  import subprocess
@@ -540,10 +540,19 @@ def shell_mode(client, args, logger=None):
540
540
  time.sleep(0.2)
541
541
 
542
542
  # Print prompt and flush to ensure it appears
543
- print(prompt_text, end='', flush=True)
543
+ sys.stdout.write(prompt_text)
544
+ sys.stdout.flush()
544
545
 
545
546
  try:
546
- response = input().lower()
547
+ # Use get_terminal_input which opens /dev/tty directly rather than using stdin
548
+ # This allows user input even when stdin has been consumed by pipe
549
+ response = get_terminal_input()
550
+ if response:
551
+ response = response.lower()
552
+ else:
553
+ # If get_terminal_input fails, default to copy
554
+ print("\nFailed to get terminal input. Defaulting to copy option.")
555
+ response = 'c'
547
556
  except KeyboardInterrupt:
548
557
  print("\nCommand execution cancelled by user.")
549
558
  return
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngpt
3
- Version: 3.8.0
3
+ Version: 3.8.1
4
4
  Summary: Swiss army knife for LLMs: powerful CLI and interactive chatbot in one package. Seamlessly work with OpenAI, Ollama, Groq, Claude, Gemini, or any OpenAI-compatible API to generate code, craft git commits, rewrite text, and execute shell commands.
5
5
  Project-URL: Homepage, https://github.com/nazdridoy/ngpt
6
6
  Project-URL: Repository, https://github.com/nazdridoy/ngpt
@@ -14,7 +14,7 @@ ngpt/cli/modes/code.py,sha256=QBFgMRPKJhxkYCmumoSkNSF15XNRGUDum5yuK8aBnyM,12662
14
14
  ngpt/cli/modes/gitcommsg.py,sha256=iTg3KlZwI0lGMcmUa62b0ashwLcxegdEEvT29PPtpBc,49595
15
15
  ngpt/cli/modes/interactive.py,sha256=TtBrZUX45CVfKOPvkb1ya7dIQhXLILtn7ajmfM9ohso,17419
16
16
  ngpt/cli/modes/rewrite.py,sha256=yPmJPPkMHNxrnV-eoM0j6lMNRhdSAMXmcw2s9xG6TIo,10918
17
- ngpt/cli/modes/shell.py,sha256=Bi5MDteUCOLc-KTecJtyUZKaY9Qab94xpN7qYz1_dOA,29487
17
+ ngpt/cli/modes/shell.py,sha256=9Bg-uPDjNgSwLULRzRxDkBXjVd1yPZLZXG-V2kPFm2k,29929
18
18
  ngpt/cli/modes/text.py,sha256=7t5WWXMFxGkBM5HMP4irbN9aQwxE2YgywjiVPep710k,6417
19
19
  ngpt/utils/__init__.py,sha256=_92f8eGMMOtQQA3uwgSRVwUEl1EIRFjWPUjcfGgI-eI,1244
20
20
  ngpt/utils/cli_config.py,sha256=Ug8cECBTIuzOwkBWidLTfs-OAdOsCMJ2bNa70pOADfw,11195
@@ -22,8 +22,8 @@ ngpt/utils/config.py,sha256=wsArA4osnh8fKqOvtsPqqBxAz3DpdjtaWUFaRtnUdyc,10452
22
22
  ngpt/utils/log.py,sha256=f1jg2iFo35PAmsarH8FVL_62plq4VXH0Mu2QiP6RJGw,15934
23
23
  ngpt/utils/pipe.py,sha256=qRHF-Ma7bbU0cOcb1Yhe4S-kBavivtnnvLA3EYS4FY4,2162
24
24
  ngpt/utils/web_search.py,sha256=w5ke4KJMRxq7r5jtbUXvspja6XhjoPZloVkZ0IvBXIE,30731
25
- ngpt-3.8.0.dist-info/METADATA,sha256=O_lTxBgnFYmKUftGTShWc7MFdHzjXRPURp2QJVhtbmo,24503
26
- ngpt-3.8.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
- ngpt-3.8.0.dist-info/entry_points.txt,sha256=SqAAvLhMrsEpkIr4YFRdUeyuXQ9o0IBCeYgE6AVojoI,44
28
- ngpt-3.8.0.dist-info/licenses/LICENSE,sha256=mQkpWoADxbHqE0HRefYLJdm7OpdrXBr3vNv5bZ8w72M,1065
29
- ngpt-3.8.0.dist-info/RECORD,,
25
+ ngpt-3.8.1.dist-info/METADATA,sha256=uiFcgSP1jz1ArOo1CUJ4FQvBZyo5Cq72_EdKzG8JEzM,24503
26
+ ngpt-3.8.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
+ ngpt-3.8.1.dist-info/entry_points.txt,sha256=SqAAvLhMrsEpkIr4YFRdUeyuXQ9o0IBCeYgE6AVojoI,44
28
+ ngpt-3.8.1.dist-info/licenses/LICENSE,sha256=mQkpWoADxbHqE0HRefYLJdm7OpdrXBr3vNv5bZ8w72M,1065
29
+ ngpt-3.8.1.dist-info/RECORD,,
File without changes