Page 1 of 2

Listc - a modern Windows file explorer/viewer in the console window

Posted: 02 Sep 2017 05:18
by misol101
Image

Wait!? This looks awfully familiar
That's right, it's a clone of Listb (viewtopic.php?t=7147), but Listc is remade and optimized for Win10/modern machines. Running listb on a Win10 machine was just painfully slow when I tried it, but this one runs well.

What is it?
Listc is a file explorer to browse/view/copy etc files inside the console window. It is also easy to extend with added funtionality building on the separate extendlistc.bat.

Where is it?
Here: http://www.mediafire.com/file/a5134mw39b8228d/listc.zip.

What are the requirements?
If you want to be able to run the script from any folder (when already in a cmd window), you should put all the files in a PATH folder. If not, you are good to go.

It is highly recommended to run listc by running l.bat. The arguments to l.bat are the same as for listc.bat, but if arguments are not given, it does a better job of setting up the environment automatically. It also enables the custom addon commands in extendlistc.bat.

What are the arguments to Listc/l.bat?
listc [path] [width] [height] [-][columns] [extend_path\name] [mouse]

[path] specifies which folder to start in. If not specified, this is ".", the current folder
[width] Number of columns
[rows] Number of rows
[columns] Number of file columns used (this can be changed while running by pressing 1-9). A negative value enables adaptive columns, and the number then represents the maximum number of columns.
[extend_path\name] Path to optional script with extended functionality for Listc (this can be either an ABOLUTE path, or a PATH folder using the syntax for that). extendlistc.bat is included, and is pointed to by l.bat by assuming it is in a PATH folder.
[mouse] if this argument is "Y", then mouse support is enabled (you can click on files to go there, doubleclick to view it, right doubleclick to run/invoke it)

Do I need to edit something before running l.bat?

The default view and edit commands are set to work for everyone at first, but I personally prefer other options. The default is to use "more" to view files, and "notepad" to edit them. I prefer to use less for view and b.exe for editing. To change this, open extendlistc.bat and search for "SETVIEWERS". Then change them to whatever you would like to use. Also, the default external viewer is set to 'less'. If it is not installed on your machine, you have to change it to something else (like more?)

Also note that extendlistc.bat is an example of custom addons, and thus, it uses a bunch of external programs. If you don't have those programs, you need to either install them or change/remove these commands (the ones used are: less, grep, my script g.bat (see another thread), dlc.exe, ansicon, unzip, zip)

What functionality does Listc have?
Press F1 or ? to see what keys are available. Most of it is centered around copying/moving/deleting one or more files (select several files with Space), but there is plenty of other functionality too, like running/showing files with 'i'.

What are the limitations?
Things get rather slow when there are a lot of files in a folder. Also, I would not be surprised if there are remaining issues with some special characters and/or spaces in file/folder names.

Re: Listc - a modern Windows file explorer/viewer in the console window

Posted: 02 Sep 2017 05:22
by misol101
What's the difference compared to listb?

Well, apart from the fact that it runs at a reasonable speed on Win10 machines instead of snail pace, the major difference is that written input to the script is received from a separate (popup) cmd window.

Why? Well, getting reasonable performance out of this script on Win10, I (again) had to run it with cmdgfx as input/output server. Since stdin is hooked by cmdgfx_input, it's not possible to get input with a simple SET /p in the same window. Thus, opening a second window for input is necessary.

Re: Listc - a modern Windows file explorer/viewer in the console window

Posted: 02 Sep 2017 10:08
by misol101
Ok, that was a bit fast. Fixed a few things, updated archive.

1. Now quits properly
2. Shows path and path-number in top bar
3. The x key works again

Re: Listc - a modern Windows file explorer/viewer in the console window

Posted: 03 Sep 2017 03:17
by siberia-man
You seemed reinvented Norton Commander in the essentially lightened mode. :-) As the toy or example of crazy programming, it could exist. Seriously!

One this I could point. Put the following lines in the beginning of listc\l.bat script. It automates putting the location of the script and other auxiliary commands in the %PATH%.

Code: Select all

for %%p in ( "%PATH:;=" "%" ) do if "%%~p\." == "%~dp0." goto :no_set_path
set "Path=%Path%;%~dp0"
:no_set_path

Re: Listc - a modern Windows file explorer/viewer in the console window

Posted: 03 Sep 2017 05:23
by misol101
siberia-man wrote:One this I could point. Put the following lines in the beginning of listc\l.bat script. It automates putting the location of the script and other auxiliary commands in the %PATH%.

Code: Select all

for %%p in ( "%PATH:;=" "%" ) do if "%%~p\." == "%~dp0." goto :no_set_path
set "Path=%Path%;%~dp0"
:no_set_path

Thanks, that's pretty clever! I will add that to the script, though personally I prefer to be able to run l.bat from a cmd window starting from any folder I am currently in, in which case the files would still have to be in a PATH folder. But as long as one is ok with always starting l.bat from its own folder then your solution works great!

Edit: updated archive to include your change

Re: Listc - a modern Windows file explorer/viewer in the console window

Posted: 03 Sep 2017 06:12
by misol101
Somebody asked if it's possible to change drive.

Yes, press '/' and type e.g. e: to see the e drive if available.

Also note that it's possible to switch between the two available path screens by pressing 'y'

Re: Listc - a modern Windows file explorer/viewer in the console window

Posted: 03 Sep 2017 07:49
by misol101
Archive updated.

Better handling of special characters in the names in the list (like &), and details mode (the + key) works again.

Re: Listc - a modern Windows file explorer/viewer in the console window

Posted: 15 Mar 2018 14:10
by misol101
Archive was updated since a few small but important fixes were made.

Listc doesn't read servercmd.dat any longer, which prevents possible sudden shutdowns when running other cmdgfx scripts from within listc.
Cmdgfx_input no longer waits in a busy-loop, ie it will no longer eat huge amounts of CPU if not being used.


Edit: One thing I'd like to point out is that to be useful, Listc (or actually, l.bat) is meant to be run from an existing cmd window. Running it from explorer (from the folder it was installed) is of course possible, but essentially quite useless. The point of Listc is that it can be run in the current folder in the current cmd window writing a simple "l", and that's when it gets useful.

Re: Listc - a modern Windows file explorer/viewer in the console window

Posted: 22 Jul 2019 06:48
by misol101
Updated archive of this oldie-but-goldie in order to support resizing of the window. In other words, the file list will now respond to any size changes of the cmd window it runs in, and it will also run properly in Fullscreen (Alt-Enter, or Ctrl-Enter for Windows 7)

Re: Listc - a modern Windows file explorer/viewer in the console window

Posted: 22 Jul 2019 18:28
by carlos
Hello misol. Nice terminal user interface.
Your program remembered me a recent discovery : an old software called List Enhanced: http://bit.ly/2OaqX6p

It seems was a very popular software in the 80-90's.

But is nice about how you can explore the content of a file. More good than see the content with the more command. You can use the arrows for explore inside the file. Maybe a good feature for your listc program.

Also I like so much the interface of the old dosshell.exe but seems hard to reprogramming it using a character window.

Carlos.

Re: Listc - a modern Windows file explorer/viewer in the console window

Posted: 31 Jul 2019 05:40
by misol101
Hi Carlos,

yes List for DOS by Vernon D. Buerg was actually precisely the inspiration for my List program, as is also mentioned in the first post of this thread: viewtopic.php?f=3&t=7147

This is also evident if you compare key shortcuts in these programs, as I took many of them straight from List as I already had them memorized (ie. q/x to quit, e to edit, i to invoke, ? to see help etc)

I don't run Dosbox though, so that's why I wanted to make this batch script version because I missed browsing around in the cmd window (and I never quite liked Norton Commander)

As for exploring the contents of file, I agree that more isn't the best option, I just chose it because it is available for everyone. You can configure my script to use any program to look at or edit files. If you start listc using l.bat, then it automatically looks for extensions inside extendlistc.bat. I have personally set it to:

Code: Select all

:SETVIEWERS
set VIEWCMD=less -f
set EDITCMD=start "" "C:\Program Files\Notepad++\Notepad++.exe"
which will use less to view the currently selected file if you press Enter, and Notepad++ if you press 'e'.

For convenient binary/hex viewing and editing, I have personally added another button 'h' and using HxD inside extendlistc.bat, like:

Code: Select all

if %LKEY% == "h" if not "!FT%CURRPOS%!"=="/" cmd /C start "" "C:\Program Files\HxD\HxD.exe" !FO%CURRPOS%!
Listc is quite easy to extend by editing extendlistc.bat! :)

Re: Listc - a modern Windows file explorer/viewer in the console window

Posted: 15 Aug 2019 08:23
by misol101
Updated the archive again because I messed up and reverted two fixes:

1. Listc doesn't read servercmd.dat any longer, which prevents possible sudden shutdowns when running other cmdgfx scripts from within listc.
2. Cmdgfx_input no longer waits in a busy-loop, ie it will no longer eat huge amounts of CPU if not being used.

Sorry about that, now fixed. Redownload the archive, OR fix both these problems yourself, by changing this line in listc.bat:

Code: Select all

cmdgfx_input.exe m0W12R | call %0 %* | cmdgfx.exe "fbox u U 20" Se
into:

Code: Select all

cmdgfx_input.exe miR | call %0 %* | cmdgfx.exe "fbox u U 20" Sei

Re: Listc - a modern Windows file explorer/viewer in the console window

Posted: 17 Jun 2020 03:08
by Bryan
Takes me back to the good old days of XtreeGold

Life was good then - even if windows was buggy...

Re: Listc - a modern Windows file explorer/viewer in the console window

Posted: 17 Jun 2020 12:22
by misol101
Bryan wrote:
17 Jun 2020 03:08
Takes me back to the good old days of XtreeGold

Life was good then - even if windows was buggy...
Oooh...nice. Never heard of it to be honest, a little before my time perhaps.

Listc was based on List.com for DOS. Listc is more configurable than List,though, but I don’t know how it compares to XtreeGold.

Re: Listc - a modern Windows file explorer/viewer in the console window

Posted: 17 Jun 2020 12:48
by Bryan
https://en.wikipedia.org/wiki/XTree

https://winworldpc.com/product/xtree/gold-3x

Made me google it and am surprised its still available for download.

Last time I was using it, circa win95/98 I guess, it was handling long file names but displayed a ~ or something to fit it into the 8.3 columns. Sort of lost its utility then because it wasn't so obvious which file(s) was highlighted (there was a key to expand it I think). It maybe couldn't get at certain system folders / files either - gray memory...

But it was the best at the time. It left File Manager (now windows Explorer) for dead.
Listc was based on List.com for DOS. Listc is more configurable than List,though, but I don’t know how it compares to XtreeGold.
I would have a look at it. I reckon you could get some good ideas (and you might even use it... :D )

Bryan