Comments (6)
On Fri, Jul 25, 2014 at 02:37:40PM -0700, yurivict wrote:
I have a terminal program that senses if the standard output is a terminal (based on isatty(1)), and automatically prints control sequences when it is a terminal.
The problem is that when run under cgdb, for some reason, isatty(1) returns 'true', but output isn't printed as colored, and control sequences are printed as clear text.
When run under just gdb, output is colored.This test case demonstrates this problem:
#include <unistd.h> #include <stdio.h> main() { if (isatty(1)) { printf("\033\[31mWe are on the terminal, this is a red text\033\[m\n"); } else { printf("We are not on the terminal, this is a black text\n"); } }
I run on kde4 konsole terminal, if this matters, on FreeBSD 9.
In general, cgdb will not make debugging other terminal programs easy.
If it's possible, you should start your program from the terminal, and
then attach to that program with cgdb from another terminal.
This way your program will have complete access to the terminal and you
can use it in any way that you previously would.
I hope this is helpful. In the future, I might provide better support
for this in CGDB.
Bob Rossi
from cgdb.
I think that cgdb tries to send terminal output to libncurses window, it strips part of the control sequence (0x1b) and this causes this problem. This appears to be a design problem: terminal output shouldn't be sent to the channel that can't accept it.
cgdb should use something 'setupterm' call from libncurses, like tmux does. But this is a major redesign.
from cgdb.
On Fri, Jul 25, 2014 at 08:43:36PM -0700, yurivict wrote:
I think that cgdb tries to send terminal output to libncurses window, it strips part of the control sequence (0x1b) and this causes this problem. This appears to be a design problem: terminal output shouldn't be sent to the channel that can't accept it.
cgdb should use something like this: setupterm, like tmux does. But this is a major redesign.
CGDB is going to get lots of major redesigns in the next 6-12 months i
hope. I'll keep this in mind.
Bob Rossi
from cgdb.
On Sun, Jul 27, 2014 at 07:39:19AM -0400, Bob Rossi wrote:
On Fri, Jul 25, 2014 at 08:43:36PM -0700, yurivict wrote:
I think that cgdb tries to send terminal output to libncurses window, it strips part of the control sequence (0x1b) and this causes this problem. This appears to be a design problem: terminal output shouldn't be sent to the channel that can't accept it.
cgdb should use something like this: setupterm, like tmux does. But this is a major redesign.
CGDB is going to get lots of major redesigns in the next 6-12 months i
hope. I'll keep this in mind.
The correct thing to do here, might be to have CGDB require tmux for
improved terminal interaction. Then CGDB could spread it's windows
across different tmux windows, and the user could display them however
they want.
I'm posting this here so I'll remember this idea when I get back to it.
Tmux is really good at terminal emulation. This isn't a problem CGDB
should be solving.
Bob Rossi
from cgdb.
this is still an issue, is there a reason this is closed?
the problem is with scr_add
in scroller.c
, I'd be interested in tackling this.
from cgdb.
I think this is still a problem.
from cgdb.
Related Issues (20)
- [feature] Can cgdb delete mark? HOT 5
- [bug] Alt-. cannot work HOT 2
- [feature] Support mouse scrollbar HOT 6
- how to change gdb program that cgdb use? HOT 1
- Cygwin BUG: [commit: 2022-06-12 208d038] fdopen was not declared in this scope
- Question: How to clear search highlights HOT 5
- cannot stat 'cgdb.htp': No such file or directory HOT 2
- file dialog freezing terminal in msys2/WSL HOT 2
- Cannot Display Color Properly HOT 2
- cgdb bug: remote connect to kdb cannot do twice HOT 3
- ESCape key mixup with readline HOT 2
- how to disable source code display in cgdb windows HOT 3
- utf support HOT 2
- [bug] Assertion in signal_handler on SIG_CHLD HOT 1
- It should be possible to disable makeinfo with configure flags HOT 1
- cgdb doesn't handle different langage path-to-file HOT 1
- REG 7bbd997: Multi-character input sequences are broken HOT 4
- Suggestion: Host release artifacts on Github
- cgdb doesn't support remote debug (gdbserver) HOT 1
- [bug] valgrind cannot display message HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cgdb.