1
I am using tramp mode in Emacs to edit files over ssh. But the problem is that on remote shell I have aliased ls as "ls --color". Tramp uses ls for auto completion and it is unable to parse color coded ls output.
The solution mentioned in https://www.gnu.org/software/tramp/#Frequently-Asked-Questions is to disable coloring of output from ls by removing the alias. I do not want to do it as it is a major feature for me.
Is there are way to redefine how tramp issues ls command so that I can keep my shell configuration and still use file name completion with tramp.
Edit 1: It seems that problem is something else. I tried changing alias to 'ls --color=auto' as suggested by @chepner and then to simply 'ls'. It still doesn't work. How can I further troubleshoot the problem?
"Renaming" a standard command via alias or function is pretty much always a bad idea. Why don't you just call your coloureful ls "lc" instead? – tink – 2013-03-12T17:54:30.290
Did you try
(setq tramp-debug-buffer t) (setq tramp-verbose 10)
? – Old Pro – 2013-05-19T19:13:31.350@OldPro Here is the debug output: http://pastebin.com/PZuxs1St
– Xolve – 2013-05-20T19:53:02.0401
Hard to make sense of that. You need to put the debug statements in your .emacs file so you can see how tramp configures itself when it loads. Probably tramp is making a bad guess. It might think /home/username is a host name and be trying to connect to that host?Or maybe it's unable to run perl scripts on the target? Just guessing. See if any of the configuration options ring a bell: https://www.gnu.org/software/tramp/#Customizing-Completion
– Old Pro – 2013-05-20T21:26:00.660