shithub: hell

Download patch

ref: 80962463c194e3d5e85b4db184ba090c7bc68f6c
parent: 826f6d6a02a324876bb96b041a299710b8f89fb8
author: penny <penny@limitedideas.org>
date: Tue Aug 12 22:19:05 EDT 2025

Build prompt with a string builder and ctrl-c clears line if not empty

--- a/main.go
+++ b/main.go
@@ -20,6 +20,7 @@
 	}
 
 	client := initClient(account)
+	
 
 	hc, err := NewHellclient()
 	rl := hc.rl
@@ -56,10 +57,16 @@
 			line, err := rl.Readline()
 			if err != nil {
 				if err == EOF || err == ErrInterrupt {
-					os.Exit(0)
+					if(len(line) == 0) {
+						os.Exit(0)
+					} else {
+						return
+					}
 				}
-				fmt.Println("Error:", err)
-				return
+				if err != nil {
+					fmt.Println("Error:", err)
+					return
+				}
 			}
 			command, arguments := processInput(line)
 
--- a/mastodon.go
+++ b/mastodon.go
@@ -165,8 +165,13 @@
 		status, err = postStatusDetailed(client, toot)
 		return
 	}
+	var sb strings.Builder
+	sb.WriteString("@")
+	sb.WriteString(getUserString(postItem))
+	sb.WriteString(" ")
+	sb.WriteString(posttext)
 	
-	toot.Status = "@"+getUserString(postItem)+" "+posttext
+	toot.Status = sb.String()
 	status, err = postStatusDetailed(client, toot)
 	return
 }
--