Disable line wrap in TCC window?

Oct 14, 2015
23
0
Batch files that view log files with long lines of data. Using find to locate the right log lines. Reading without wrapping is a lot easier. I can set the line wrap length on a normal cmd window to like 9999 but I don't see that option anywhere with tcc. Am I missing it?
 
Jun 2, 2008
366
4
You can set the buffer width for the console window to a maximum of 9999. Right click the title bar, go to Properties, then the Layout tab. I'm not familiar with setting the line wrap in CMD.

1658971922176.png
 
May 30, 2022
31
0
The screen capture in post number 4, just above, is from ConHost, not from TCC. You can get exactly the same thing from CMD or TCC as long as they are running inside ConHost, and you bring up the Properties.
 
Oct 14, 2015
23
0
I can detach the TC console from the TC shell and adjust the layout accordingly but new TCC sessions within the TC shell never seem to inherit that config.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,606
98
Albuquerque, NM
prospero.unm.edu
I think Take Command goes to some lengths to prevent the console buffer from being wider than the display window. I personally like this approach; side-to-side scrolling is something I'd rather avoid.
 
Oct 14, 2015
23
0
I agree that side-to-side scrolling in most cases is a pain but when trying to decipher long log lines it can be helpful to not wrap text.
 
Oct 14, 2015
23
0
Thanks for the suggestion. Unfortunately my batch file searches multiple log repositories with different commands and formats the output into the TCC window with csv headers and colorized break point text so I can (when needed) copy the entire output and paste it into a spreadsheet for more in depth review. I need the side-to-side scroll function to know if I see the info quickly or if I need to dump it into a spreadsheet.
 
Dec 29, 2009
48
1
Atlanta, GA
@David_Wolfe - there are a couple of options that you could use to maybe accomplish something close to what you want:
  1. Pipe to VIEW
  2. Diddle the registry directly.
By piping to the VIEW command, you can easily turn word wrap on/off and do a lot of other things. That's what I would more strongly recommend doing.

However, I am a stubborn software developer who wants things exactly the way I want them, so I can hardly fault others for the same attitude, LOL.

In the registry, there's HKEY_CURRENT_USER\Console. Under that are several subkeys, and there should be one there for the last time you used TCC. (If it didn't create one for a TCC instance hosted by TCmd, then run TCC directly once and see if the key shows up.)

You can try using the @REGSET built-in function, or the REG Windows command to change the value of ScreenBufferSize and/or WindowSize, and see where that gets you. I'd work in a bare console TCC session and try getting it to behave the way I wanted there and then see if it carries over into TCC being run in a TCmd window.

You have to know how to parse the single value in both of those into rows & columns.

The Registry documentation for ScreenBufferSize is here:

And for WindowSize, it's here:


Be sure to let us know whether you're successful, and what worked.
This can be a useful resource for others desiring to do the same thing.
 
May 20, 2008
11,926
124
Syracuse, NY, USA
How about (something like) this?

Go to TCC.EXE's home directory and copy tcc.exe to widetcc.exe. Start widetcc.exe in it's own window. Go to Properties\Layout, uncheck wrap_text_on_resize, and set the screen buffer width to whatever you want (I used 1000 below).

1661620317957.png


[Note: WIDETCC.EXE will get its own subkey of HKCU\Console with the settings you specify.]

At the beginning of your batch file, test that there are the desired number of columns, and if not, restart the batch file using widetcc.exe, maybe like this.

Code:
if %_columns != 1000 (start d:\tc28\widetcc.exe /k %0 & quit)

It works here.

1661620910673.png
 
May 20, 2008
11,926
124
Syracuse, NY, USA
Another way.

At the beginning of your batch file, put something like this. It will work even if "wrap ..." is checked (and leave it checked).

Code:
mode con: cols=9999 lines=42

That will have the side-effect of enlarging (horizontally) the window to the width of one monitor (but it won't center the window on the monitor). You could then move the window with (for example)

Code:
WINDOW /pos=0,0,*,*
 
May 20, 2008
11,926
124
Syracuse, NY, USA
The technique I mentioned in post #12 also works if WIDETCC.EXE is a symbolic link or a hard link. That is, the settings you give it are remembered in a uniquely named subkey of HKCU\Console and used when WIDETCC.EXE is run.

Edit: You can do it with a shortcut too.
 
Last edited:
Oct 14, 2015
23
0
Thanks forbin & vefatica.

forbin: Unfortunately checking hkey_current_user\console shows that the SreenBufferSize setting is already set for 9999 columns (0x1388270f = 270f columns = 9999 columns) so that control isn't being honored when TCmd is attached to a TC shell. Thanks though for pointing me to where that config is kept for console apps.

verfatica: The hope was to disable wrapping when TCmd was attached to a TC shell. I realize I can adjust the wrap and columns in a separated TCmd window but I like the centralization of having a TCC, CMD and Powershell all under one roof so I can test things easily across different consoles.

I'll fiddle with piping to view on the multple commands I output log info from and see if I can get it unified in one screen. Thanks all.
 

Similar threads