git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Fwd: [PATCH] Remove terminal symbols from non-terminal console

From
MNMichael Naumov <mnaoumov@gmail.com>
Date
Nov 5, 2012, 23:17 UTC
Message-ID
<CABHRWd16k6B4Ybvc4k7z29_A9Q2wZVXA__Bov8Pst4cc2H0cmg@mail.gmail.com>
In-Reply-To
<CABHRWd1T=a8Mze20G9koiTr0L2Nrq0g3vGLC9mEZ7rA45vgfSA@mail.gmail.com>

As per discussion on msysgit user group: https://groups.google.com/forum/?fromgroups=#!topic/msysgit/U_a982_a3rc/discussion we found the following patch is required to get rid of weird terminal characters for other tools such as GitExtensions for Windows

---8<---
diff --git a/sideband.c b/sideband.c
index d5ffa1c..bd3e5a8 100644
--- a/sideband.c
+++ b/sideband.c
@@ -29,7 +29,7 @@ int recv_sideband(const char *me, int in_stream, int out)

  memcpy(buf, PREFIX, pf);
  term = getenv("TERM");
- if (term && strcmp(term, "dumb"))
+ if (isatty(out) && term && strcmp(term, "dumb"))
  suffix = ANSI_SUFFIX;
  else
  suffix = DUMB_SUFFIX;
---8<---
Next: Jeff King
Message 1 of 2 in “Fwd: [PATCH] Remove terminal symbols from non-terminal console”
  1. Michael NaumovNov 5, 2012
  2. Jeff KingNov 8, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.