Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Another weird issue, this time with Neovim and the Flog plugin

Aug
184
5
I increasingly use Neovim constantly. I'm fighting even now not to gush about it as an editor. As with so many things, I need to use it across Linux, macOS, and Windows (ick). And on Windows, my preferred shell is TCC by a country mile for basically all the reasons it exists in the first place. But every once in a while, I run into some weird compatibility thing, and I think I've hit another such use case.

One of the Neovim plugins I'm trying to use is called Flog, which basically gives you a highly useful visual display of your Git branching history for a given Git repo. Only it wouldn't work for me at all when I tried it. I posted an issue to its GitHub repo and the kind folks over there started trying to help me. Along the way, I discovered that oddly enough the plugin is failing for me only when I'm running Neovim in TCC. If I run the very same Neovim with the very same configuration in CMD or PowerShell, it works just fine. But when I run Neovim in TCC and try to use the plugin I just get an empty buffer where a list of Git commits is supposed to be.

From the back and forth with the devs, I'm inclined to think it has something to do with the git command they're launching to generate the graph and then bring it into the editor. Only I can run those commands just fine either from the command line or in Neovim whether I'm running in CMD, PowerShell, or TCC. I've tried removing all my aliases and taking other steps to maximize compatibility with CMD, but so far that hasn't paid off. So now I'm posting here in the hope that support might point me in the right direction for further diagnosis. Some of my questions in particular would be:

1. Is there any way to capture the system shell commands run by the Neovim plugin while it's running in TCC? Maybe if I could capture that via some TCC mechanism I could find the issue.
2. Is there somewhere an explicit document or reference on what TCC settings I should adjust for maximum compatibility with CMD, particularly issues relating to piping output and such?

And really, any other ideas anyone might have at this point would be welcome. For the time being, I'm sucking it up and trying to make do with PowerShell, but I truly despise it compared to TCC. Thanks in advance for anything.
 
An update to my own post after the plugin author got back to me: the command that the plugin is running is as follows:

git -C E:/Src/Dotfiles --git-dir E:/Src/Dotfiles/.git log --parents --topo-order --no-color --pretty="format:__START""n""h""n""p""n""D""n""ad [""h] {""an}""d ""s" --date=iso --max-count=5000 --

It runs fine in CMD and PowerShell, but here's the error it's giving me when run in TCC:

Thu 1/02/25 13:03:12 Mem(26%) Dirs() LastCmd(0)
E:\Src\Dotfiles> git -C E:/Src/Dotfiles --git-dir E:/Src/Dotfiles/.git log --parents --topo-order --no-color --pretty="format:__START""n""h""n""p""n""D""n""ad [""h] {""an}""d ""s" --date=iso --max-count=5000 --

fatal: {an}d: no such path in the working tree.
Use 'git <command> -- <path>...' to specify paths that do not exist locally.

I confess I'm a little unclear on what's wrong with it. Maybe a string escaping thing? Thanks in advance.
 
1. Is there any way to capture the system shell commands run by the Neovim plugin while it's running in TCC? Maybe if I could capture that via some TCC mechanism I could find the issue.

Are you trying to use TCC (and if so, which version?) or TCC/LE (you posted this in the TCC/LE forum)?

You could turn on logging in TCC (i.e., in your TCSTART) which will capture the commands being passed to TCC.

Or you could look at the variables that TCC sets when running a command (%CMDLINE and %CMDLINE2).

2. Is there somewhere an explicit document or reference on what TCC settings I should adjust for maximum compatibility with CMD, particularly issues relating to piping output and such?

And really, any other ideas anyone might have at this point would be welcome. For the time being, I'm sucking it up and trying to make do with PowerShell, but I truly despise it compared to TCC. Thanks in advance for anything.

You could alias NeoVIM to set COMSPEC to CMD.EXE before running NeoVIM, and reset it to TCC when it exits.

That git command line is a bit bizarre, but there aren't any variables or escape characters that TCC would try to interpret.

The TCC help has a "CMD Compatibility" topic (under "Reference") that discusses some of the CMD bug / "feature" compatibility settings.
 
Are you trying to use TCC (and if so, which version?) or TCC/LE (you posted this in the TCC/LE forum)?

You could turn on logging in TCC (i.e., in your TCSTART) which will capture the commands being passed to TCC.

Or you could look at the variables that TCC sets when running a command (%CMDLINE and %CMDLINE2).



You could alias NeoVIM to set COMSPEC to CMD.EXE before running NeoVIM, and reset it to TCC when it exits.

That git command line is a bit bizarre, but there aren't any variables or escape characters that TCC would try to interpret.

The TCC help has a "CMD Compatibility" topic (under "Reference") that discusses some of the CMD bug / "feature" compatibility settings.

Ding! Ding! Ding! We have a winnah! Or at least a workaround. Thanks for that. I don't know why it didn't occur to me to change COMSPEC temporarily. I remember using that old trick back in the 4DOS days. Geez. I'm glad to hear I wasn't missing any variables/escape characters either. That almost seems like a compatibility failure of interpretation or something. I don't know why that command doesn't work with TCC. I just whipped up a quickie nvim.bat file which does the trick nicely:

@echo off
setlocal
set ComSpec=cmd.exe
nvim.exe %*
 
Back
Top