[PR #1147] [MERGED] handle KeyCtrlJ as newline during paste #1140

Closed
opened 2026-03-04 01:09:38 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rivo/tview/pull/1147
Author: @laborin
Created: 3/2/2026
Status: Merged
Merged: 3/2/2026
Merged by: @rivo

Base: masterHead: master


📝 Commits (1)

  • 2a2df46 handle KeyCtrlJ as newline during paste

📊 Changes

1 file changed (+2 additions, -0 deletions)

View changed files

📝 application.go (+2 -0)

📄 Description

This PR fixes paste newline handling by mapping tcell.KeyCtrlJ to \n in paste mode.

In some terminals (like Alacritty), pasted multiline text sends line feeds as KeyCtrlJ instead of KeyEnter. Without this mapping, pasted text collapses into one line.

Fixes https://github.com/rivo/tview/issues/1068


🔄 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/rivo/tview/pull/1147 **Author:** [@laborin](https://github.com/laborin) **Created:** 3/2/2026 **Status:** ✅ Merged **Merged:** 3/2/2026 **Merged by:** [@rivo](https://github.com/rivo) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`2a2df46`](https://github.com/rivo/tview/commit/2a2df46fea4e7b2de8e37440797f4a025f822f6d) handle KeyCtrlJ as newline during paste ### 📊 Changes **1 file changed** (+2 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `application.go` (+2 -0) </details> ### 📄 Description This PR fixes paste newline handling by mapping tcell.KeyCtrlJ to \n in paste mode. In some terminals (like Alacritty), pasted multiline text sends line feeds as KeyCtrlJ instead of KeyEnter. Without this mapping, pasted text collapses into one line. Fixes https://github.com/rivo/tview/issues/1068 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 01:09:38 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#1140
No description provided.