summaryrefslogtreecommitdiff
path: root/internal/task
diff options
context:
space:
mode:
authorPaul Bütow <1224732+snonux@users.noreply.github.com>2025-06-20 09:52:14 +0300
committerGitHub <noreply@github.com>2025-06-20 09:52:14 +0300
commit5d32fb6d89450fa387f9f4c51b561324075a4964 (patch)
tree07e067bd7b6ec342aa042ef5d9dc385a9f902a6a /internal/task
parent4c4e186b14b91163beb8316aff6eeda86f9dc171 (diff)
parent4dd9b8a6340bb7d4d4d77599a42ee09e17c9bb92 (diff)
Merge pull request #12 from snonux/codex/investigate-and-fix-charm.sh-tui-issue
Fix external editor invocation
Diffstat (limited to 'internal/task')
-rw-r--r--internal/task/task.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/internal/task/task.go b/internal/task/task.go
index f7a3f73..12671a9 100644
--- a/internal/task/task.go
+++ b/internal/task/task.go
@@ -142,6 +142,15 @@ func Denotate(id int, annoID int) error {
}
// Edit opens the task in an editor for manual modification.
+// EditCmd returns an exec.Cmd that edits the task with the given id.
+// The caller is responsible for running the command, typically via
+// tea.ExecProcess so that the terminal state is properly managed.
+func EditCmd(id int) *exec.Cmd {
+ return exec.Command("task", strconv.Itoa(id), "edit")
+}
+
+// Edit opens the task in an editor for manual modification.
+// This is a convenience wrapper around EditCmd.
func Edit(id int) error {
- return run(strconv.Itoa(id), "edit")
+ return EditCmd(id).Run()
}