Recent

Author Topic: Debugging Feature request/suggestion  (Read 1377 times)

440bx

  • Hero Member
  • *****
  • Posts: 4550
Debugging Feature request/suggestion
« on: August 15, 2024, 09:02:43 pm »
Hello,

when debugging a console application it is fairly common to have the console window either partially or totally obscured by other windows (usually Lazarus windows - editor windows, watches, messages, etc.)

Currently to bring the console window to the front, it usually requires using the mouse to click on a partially visible area of the console or click on the taskbar button that represents the app.

It would be much nicer and convenient to have a hotkey to bring the window to the front.

That's the suggestion/request: implement a hotkey to bring the console window to the foreground.

comments welcome.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10306
  • Debugger - SynEdit - and more
    • wiki
Re: Debugging Feature request/suggestion
« Reply #1 on: August 15, 2024, 10:11:22 pm »
Pretty long shot....

I guess on Windows it is possible, but for console only.

GUI wouldn't work, because it is frozen at that time (unless focus remains for some reason on the IDE, when it was continued with F9 / I don't recall having had that issue)

On Linux, you normally have the IDE build in console window (which may be offered as option under Windows too - at some point).
Or on Linux you have used a "launch app" (though that hasn't worked for a decade) and then the the launch app is an independent app, and wouldn't necessary be tracked...

On Windows, it would depend on the Win API, if you can bring a console window to the front, if all you have is the handle of the process running in it....

And then it would be a windows only feature. Wouldn't reject it, but with the tons of other stuff going on....




Are you aware that with Lazarus 3.99 (Windows) under "Run Params" you can specify the position of the console win. (size or row/column partially works).

So if you have a corner of free space on the screen, you should be able to make sure it will always be there.


Also, if you have just only worked in the IDE, and nothing else, then "Alt Tab" should switch to it?
« Last Edit: August 15, 2024, 10:13:03 pm by Martin_fr »

440bx

  • Hero Member
  • *****
  • Posts: 4550
Re: Debugging Feature request/suggestion
« Reply #2 on: August 16, 2024, 06:18:13 am »
I guess on Windows it is possible, but for console only.
Yes, that's correct.

On Windows, it would depend on the Win API, if you can bring a console window to the front, if all you have is the handle of the process running in it....
It can be done.  The debugger would need to enumerate the windows and identify the debuggee's window.  To ensure it doesn't do it for GUI apps, it can check what type of process it is debugging (PE subsystem.)  Fortunately, it would only need to do it once.

Are you aware that with Lazarus 3.99 (Windows) under "Run Params" you can specify the position of the console win. (size or row/column partially works).
No, I wasn't aware of that.  I use the console's "properties -> layout" (right click on caption) then set the window's width, height and uncheck "let the system position the window".  That puts the console window in a desired location along with window size (horizontal and vertical) as well as setting the screen buffer size.  Very nice is that the settings are persistent, Windows will honor those setting in subsequent runs (even when not being debugged.)  Also nice is that it always works, so far 100% reliable.

Also, if you have just only worked in the IDE, and nothing else, then "Alt Tab" should switch to it?
The problem is that my screen is  often _not_ large enough to accommodate the Lazarus windows and the console window.  For instance, in the project I'm working on, I have two Lazarus editor windows and the console window is 160 columns wide (some of the lines output are quite long), my 1920 wide screen is too narrow for that. 

I understand it's not a "critical" feature but, it would be nice to have.  It's a bit unfortunate that it would be Windows-only if it were implemented.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5678
  • Compiler Developer
Re: Debugging Feature request/suggestion
« Reply #3 on: August 18, 2024, 11:49:52 am »
Currently to bring the console window to the front, it usually requires using the mouse to click on a partially visible area of the console or click on the taskbar button that represents the app.

Alt + Tab not working for you? That's what I use when debugging the compiler (which is a console application after all as well)...

440bx

  • Hero Member
  • *****
  • Posts: 4550
Re: Debugging Feature request/suggestion
« Reply #4 on: August 18, 2024, 01:06:31 pm »
Alt + Tab not working for you? That's what I use when debugging the compiler (which is a console application after all as well)...
Alt-Tab works if no other application window has been activated between the debugger and the debuggee.  I somewhat often have other apps active to assist in the debugging, e.g, a hex viewer/editor, a PE dump of the exe and, other things as well.  Alt-Tab works well when flipping from two apps but isn't convenient when dealing with multiple apps.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

ASBzone

  • Hero Member
  • *****
  • Posts: 713
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: Debugging Feature request/suggestion
« Reply #5 on: August 19, 2024, 07:41:19 am »
Alt-Tab works well when flipping from two apps but isn't convenient when dealing with multiple apps.

From your signature, I take it that you're still running Windows 7.   I can't remember the default Win7 behavior in this regard, but in both Windows 10 and 11, Alt-Tab will bring up all the current windows, and allow you to cycle through them (as usual), or just click on the one you want with the mouse, which is very convenient.

And I realize that this will not lead you to run either of those editions of Windows... 😁
-ASB: https://www.BrainWaveCC.com/

Lazarus v3.5.0.0 (2216170cde) / FPC v3.2.3-1387-g3795cadbc8
(Windows 64-bit install w/Win32 and Linux/Arm cross-compiles via FpcUpDeluxe on both instances)

My Systems: Windows 10/11 Pro x64 (Current)

440bx

  • Hero Member
  • *****
  • Posts: 4550
Re: Debugging Feature request/suggestion
« Reply #6 on: August 19, 2024, 08:26:17 am »
From your signature, I take it that you're still running Windows 7.   I can't remember the default Win7 behavior in this regard, but in both Windows 10 and 11, Alt-Tab will bring up all the current windows, and allow you to cycle through them (as usual), or just click on the one you want with the mouse, which is very convenient.
Yes, I am still running Windows 7.   I occasionally run Win10 in a VM to use Visual Studio and Windbg preview edition.  Those are the only two things I use Win10 for.  I also "use" it to ensure the programs I write run under Win10 but, it's limited to about 2 minutes of testing, 5 minutes in the best case.  Anyway...

The alt-tab behavior is pretty much the same in Win 7 as it is in Win10 (I don't use the Aero interface, therefore it's not quite as nice looking.)  Alt-Tab can be made to work but it would be very nice that once back in Lazarus to resume debugging, then a _single_ key combination would bring the console window back.

With Alt-Tab it's not convenient when the window sequence isn't "Lazarus <-> console app". When one or more apps have been activated then it will take alt-tabbing through several apps to get back to the "Lazarus->console app" sequence/view.

It would definitely save time to have a key combination in Lazarus that brings the debuggee's console window back into view.  That way, going back to Lazarus is all that's needed to resume debugging.

It is quite common for me to have Lazarus, Multi-edit, a hex editor, a memory viewer and one or two console windows to display information that is in some way related to the program I'm debugging.  IOW, my debugging isn't limited to switching from Lazarus to the debuggee back and forth.  Alt-Tab is great to switch back and forth between two apps but, for more than two it can be time consuming.

(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018