[PR #1188] [MERGED] Improve interrupt handling in pkl repl #933

Closed
opened 2025-12-30 01:27:50 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/apple/pkl/pull/1188
Author: @HT154
Created: 8/26/2025
Status: Merged
Merged: 8/29/2025
Merged by: @HT154

Base: mainHead: repl-ctrl-c


📝 Commits (1)

  • 9771e4b Improve interrupt handling in pkl repl

📊 Changes

1 file changed (+14 additions, -1 deletions)

View changed files

📝 pkl-cli/src/main/kotlin/org/pkl/cli/repl/Repl.kt (+14 -1)

📄 Description

The REPL now handles interrupts (Ctrl-C) in a more user-friendly way. Instead of exiting immediately, it behaves like other REPLs:

  • If the line is non-empty or in a continuation, the buffer is cleared.
  • If the line is empty, print a message with instructions on exiting the REPL.
    • If another interrupt is sent immediately after, exit.

Pressing Ctrl-D immediately exits the REPL, as before.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/apple/pkl/pull/1188 **Author:** [@HT154](https://github.com/HT154) **Created:** 8/26/2025 **Status:** ✅ Merged **Merged:** 8/29/2025 **Merged by:** [@HT154](https://github.com/HT154) **Base:** `main` ← **Head:** `repl-ctrl-c` --- ### 📝 Commits (1) - [`9771e4b`](https://github.com/apple/pkl/commit/9771e4b90376300a95f4502310d805b689966ed2) Improve interrupt handling in `pkl repl` ### 📊 Changes **1 file changed** (+14 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/repl/Repl.kt` (+14 -1) </details> ### 📄 Description The REPL now handles interrupts (Ctrl-C) in a more user-friendly way. Instead of exiting immediately, it behaves like other REPLs: * If the line is non-empty or in a continuation, the buffer is cleared. * If the line is empty, print a message with instructions on exiting the REPL. * If another interrupt is sent immediately after, exit. Pressing Ctrl-D immediately exits the REPL, as before. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 01:27:50 +01:00
adam closed this issue 2025-12-30 01:27:50 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#933