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>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 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:
main← Head:repl-ctrl-c📝 Commits (1)
9771e4bImprove interrupt handling inpkl 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:
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.