Git Bash is displaying strange characters on Windows 7 [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I installed Gitbash in my Windows and defined the Linux command lines (ls to list directory for example) but the command line is returning strange characters.
Reginaldo#Dell MINGW64 /c/dev/php/laravel/flamboyant (master)
$ php artisan
←[32mLaravel Framework←[39m version ←[33m5.1.29 (LTS)←[39m
←[33mUsage:←[39m
command [options] [arguments]
←[33mOptions:←[39m
←[32m-h, --help←[39m Display this help message
←[32m-q, --quiet←[39m Do not output any message
←[32m-V, --version←[39m Display this application version
←[32m --ansi←[39m Force ANSI output
←[32m --no-ansi←[39m Disable ANSI output
←[32m-n, --no-interaction←[39m Do not ask any interactive question
←[32m --env[=ENV]←[39m The environment the command should run under.
←[32m-v|vv|vvv, --verbose←[39m Increase the verbosity of messages: 1 for norm
al output, 2 for more verbose output and 3 for debug
←[33mAvailable commands:←[39m
←[32mclear-compiled←[39m Remove the compiled class file
←[32mdown←[39m Put the application into maintenance mode
←[32menv←[39m Display the current framework environment
←[32mhelp←[39m Displays help for a command
←[32minspire←[39m Display an inspiring quote
←[32mlist←[39m Lists commands
←[32mmigrate←[39m Run the database migrations
←[32moptimize←[39m Optimize the framework for better performance
←[32mserve←[39m Serve the application on the PHP development ser
ver
←[32mtinker←[39m Interact with your application
←[32mup←[39m Bring the application out of maintenance mode
←[33mapp←[39m
←[32mapp:name←[39m Set the application namespace
←[33mauth←[39m
←[32mauth:clear-resets←[39m Flush expired password reset tokens
←[33mcache←[39m
←[32mcache:clear←[39m Flush the application cache
←[32mcache:table←[39m Create a migration for the cache database table
←[33mconfig←[39m
←[32mconfig:cache←[39m Create a cache file for faster configuration loa
ding
←[32mconfig:clear←[39m Remove the configuration cache file
←[33mdb←[39m
←[32mdb:seed←[39m Seed the database with records
←[33mevent←[39m
←[32mevent:generate←[39m Generate the missing events and listeners based
on registration
←[33mhandler←[39m
←[32mhandler:command←[39m Create a new command handler class
←[32mhandler:event←[39m Create a new event handler class
←[33mkey←[39m
←[32mkey:generate←[39m Set the application key
←[33mmake←[39m
←[32mmake:command←[39m Create a new command class
←[32mmake:console←[39m Create a new Artisan command
←[32mmake:controller←[39m Create a new resource controller class
←[32mmake:event←[39m Create a new event class
←[32mmake:job←[39m Create a new job class
←[32mmake:listener←[39m Create a new event listener class
←[32mmake:middleware←[39m Create a new middleware class
←[32mmake:migration←[39m Create a new migration file
←[32mmake:model←[39m Create a new Eloquent model class
←[32mmake:policy←[39m Create a new policy class
←[32mmake:provider←[39m Create a new service provider class
←[32mmake:request←[39m Create a new form request class
←[32mmake:seeder←[39m Create a new seeder class
←[32mmake:test←[39m Create a new test class
←[33mmigrate←[39m
←[32mmigrate:install←[39m Create the migration repository
←[32mmigrate:refresh←[39m Reset and re-run all migrations
←[32mmigrate:reset←[39m Rollback all database migrations
←[32mmigrate:rollback←[39m Rollback the last database migration
←[32mmigrate:status←[39m Show the status of each migration
←[33mqueue←[39m
←[32mqueue:failed←[39m List all of the failed queue jobs
←[32mqueue:failed-table←[39m Create a migration for the failed queue jobs dat
abase table
←[32mqueue:flush←[39m Flush all of the failed queue jobs
←[32mqueue:forget←[39m Delete a failed queue job
←[32mqueue:listen←[39m Listen to a given queue
←[32mqueue:restart←[39m Restart queue worker daemons after their current
job
←[32mqueue:retry←[39m Retry a failed queue job
←[32mqueue:subscribe←[39m Subscribe a URL to an Iron.io push queue
←[32mqueue:table←[39m Create a migration for the queue jobs database t
able
←[32mqueue:work←[39m Process the next job on a queue
←[33mroute←[39m
←[32mroute:cache←[39m Create a route cache file for faster route regis
tration
←[32mroute:clear←[39m Remove the route cache file
←[32mroute:list←[39m List all registered routes
←[33mschedule←[39m
←[32mschedule:run←[39m Run the scheduled commands
←[33msession←[39m
←[32msession:table←[39m Create a migration for the session database tabl
e
←[33mtracker←[39m
←[32mtracker:tables←[39m Create the migrations for Tracker database table
s and columns
←[33mvendor←[39m
←[32mvendor:publish←[39m Publish any publishable assets from vendor packa
ges
←[33mview←[39m
←[32mview:clear←[39m Clear all compiled view files
Reginaldo#Dell MINGW64 /c/dev/php/laravel/flamboyant (master)
Can someone help me please?

You need to enable ansi control code processing. See here for details.
By Jason Karns in shell
Link content included for reference in case link ever gets deleted.
Having used git on windows for over three years now, I’ve fallen back in love with the command line. Bash, of course, not the windows command prompt. Beautiful, ubiquitous, warty bash. Git depends heavily on GNU utilities so on Windows it requires either cygwin or msys. Having been burned by cygwin in the past, I prefer the minimalism and simplicity of msys + mingw. Along with git, the entire ruby ecosystem lives in the shell. However, the numerous tools, gems and utilities that assume standard ANSI color support in the shell began to wear on me. Lo and behold, there is a lovely solution to provide ansi color support for bash (and cmd) on Windows: ansicon.
Download the zip and extract. There are a few ways to install:
Extract to a permanent location (I use C:/bin/ansicon). Execute ansicon.exe -i from within the appropriate directory for your system (x86/x64), and you’re all set. Any new shells (bash and windows cmd included) will autorun the ansicon utility for displaying color output. Be sure not to move the executable prior to running ansicon.exe –u. This removes the registry entry and prevents an ugly error message for every command shell.
Alternatively, place the ansicon executable in your PATH, or add its location to your PATH. Then you can launch ansicon for a session with ansicon.exe –p.
This utility has been working great for my on Windows XP. I’ve been having trouble getting it to work on Windows 7, but I hear it should be supported. I’ll post an update when the Windows 7 issue is resolved.
Update
Root cause, uncovered! If you use JRuby with a 64-bit JVM on Windows x64, ansicon won’t work. The issue is that ansicon (64-bit) is capable of injecting into 32-bit processes, but not vice versa. Currently, the JRuby launcher is a 32-bit executable. Thus, if you’re running a 64-bit shell (cmd, bash, or otherwise), ansicon will inject correctly into that process. It will then inject successfully into the 32-bit JRuby launcher process. At this point, for all intents and purposes, you’re running the 32-bit version of ansicon. Thus, if you’re running JRuby on a 64-bit JVM, then 32-bit ansicon is not able to inject into 64-bit JVM. There is an open feature request for JRuby to ship its 64-bit version with a 64-bit launcher. You should vote for this feature. I also hear that adoxa (Jason Hood) has a potential fix for this issue in the works. Stay posted.
Of course, the easiest solution at the moment is to ensure that JRuby uses a 32-bit JVM. Just change (or set) your JAVA_HOME environment variable to point to a 32-bit JVM and you’re golden.
Update 2: Issue Resolved
The latest 64-bit binaries (ansi6432.zip) have fixed the issue. Just download and extract them over-top the 1.51 version.

For MingGW64 I found going into the Options > Terminal and switching from xterm (the default I presume) to xterm-256color fixed the issue. I also restarted the console.

This answer helped me with my weird characters in gradle output from git bash in windows. Just add export TERM=cygwin to the last line of git/etc/bash.bashrc. If this helps you, be sure to send the upvotes to their answer—I'm only reposting it here since this is where google brought me.

I didn't remember the last version of GIT. I faced same problem after updating Git Bash to 2.11.
Downgrading to 2.10 solved my problem.
https://github.com/git-for-windows/git/releases/tag/v2.10.0.windows.1

Related

Setting up development environment in Windows 10 without admin rights

Let me give a quick background of the work I do and then I'll explain the problem I am facing.
I am a software developer with more than 15+ years work experience. My work involves a lot of varied tasks:
data analysis using R, Python
development of web applications using Ruby on Rails, JS, etc.
building models using open source libraries
So far, I have been doing all this in my personal laptop (Ubuntu 18.04) and have faced no issues.
But I would soon need to start using a laptop provided by the organisation that I am working for. This org is not a IT company, it's a public body. They only use Windows (10) and don't provide admin access to anyone. It's very hard to get permission to install any kind of "approved" software. Just to give an example, they refused to install Chrome in my laptop as they wouldn't be able to control the updates.
So here's my problem - what do I do to work peacefully using their laptop? The primary reason I have to use the work laptop is that there are a lot of important documents kept in shared drives that are accessible only in their machines.
I have been looking at options like WSL or Hyper-V. But, before I put in a request to the IT team to get them to agree, I wanted to know a few things:
1) Which among WSL or Hyper-V would be the better approach for setting up the dev environment that I want?
2) IF I get the IT team to install WSL/HV, would I be able to set up everything else without having to go back to them for each software? Is there a way of secure local admin access these options would provide that will ease their concerns?
3) Is there some other way of setting up what I want?
If still applicable and actual I can share my solution:
If you should work on a windows machine where you don’t have administrative privileges, you can very easily make a portable R/Rstudio installation.
Download a recent version of R from the CRAN site and the recent version of RStudio. After download extract RStudio installation exec with 7Zip and copy files from $_OUTDIR to the desired location (in case you making an update, simply overwrite all files, that already exist). Your RStudio executable will be in
your-chosen-directory/bin/rstudio.exe
Then run CRAN-R installation, ignore the warning that you don’t have administrative privileges and go forward until installation will complete. Run RStudio, from the menu
Tools->Global Options
locate where your R installation is located.
If you performing an update (more recent version of R), copy all files from the library subfolder of the old R installation into new, but this time DON’T OVERWRITE! This operation vill preserves the packages you have installed in the previous version of R. After copying update all your packages from the RStudio window (Packages->Update). When the packages update process will end check which packages failed to update (You will see warning messages near them in the RStudio console). Remove these packages (write down names of failed packages and delete corresponding folders from library subfolder). For this, you will need to exit from RStudio. After deletion launch RStudio again and execute the packages install command in the RStudio console:
install.packages(c("package1", "package2", "package3"))
Congratulations, You are ready to go!

Bamboo 5.5.0 - How to delete a remote agent's capability via the bamboo-capabilities.properties file?

I am currently trying to automate the process of bamboo remote agent installation and uninstallation. I have run into a problem in regards to adding and removing capabilities.
What I am trying to automate:
(The following is what I do on the bamboo server via the GUI, I want to do this on the remote agent machine via bash script.)
I install the remote agent on a VM machine, then start it up. I go to the bamboo interface and click on the newly created agent's name.
I add a custom capability type, for the key I put 'buildserver' and for the value I put the name of the agent.
I add an 'Executable' capability of type 'Command' with Executable label 'cygwin' and path 'C:\cygwin64\bin\bash'
I navigate to the git executable, and remove it by clicking 'delete.' <--- (the problem step)
what I've done.
I have looked here and found a way to automate steps 1-3 using the following "bamboo-capabilities.properties" file:
buildserver="AGENTNAME"
system.builder.command.cygwin="C:\cygwin64\bin\bash"
However I am stuck on how I would remove the git capability (step 4.) I've tried something appending something like this to the file:
system.git.executable=""
but it does not seem to do anything. Does anyone know how I would do this? There seems to be very little documentation about this online.
Thanks very much.
I never found a way to get around this, but I found a workaround. I later learned the point of removing git in my situation was to allow a shared capability that was also called git to take precedence. My workaround was to set the non-shared capability to the value of the shared capability. I am not 100% sure that this does the same thing, and I am not in a position to test it yet, but as a capability seems to be only a key-value pair I don't see why it wouldn't.... will update if anything breaks.

AutoHotkey Run command issue in Windows 8.1

this is my first time on such a prestidigious site, so please welcome me by assisting me. I am doing independent development and am primarily a music designer. So that is why I may not sound like a real pro coder but nevertheless truly love creating my music through automative processes.
My present issue is this:
Windows 8.1 Pro
AutoHotkey 1.0.48.5 32bit (running as Admin)
Everytime I attempt to use the command 'RUN' with an .ahk target, I get the expected result except that the .ahk residing folder is opened by MS Explorer. I suspect that something like the fact that AutoHokey is an unsigned app, windows does not want it to run flawlessly. I am now trying a number of Administrative Tool Services disabling, but with no success yet.
RUN C\:XZN\Mecanisms\AnyAHK_script.ahk
;;or
RUN AnyAHK_script.ahk, C\:XZN\Mecanisms
;;or
RUN C\:XZN\Mecanisms\BactchfileLaunchingAboveScript.bat
;;or
RUN AnyAHK_script.ahk, C\:XZN\Mecanisms
Would there be a workaround this at the OS settings level or another way to run/start an .ahk file?
I tried the 'Comspec' approach as well as running an .ahk from within a batchfile, but the .ahk always get intercepted whenever it contains a 'RUN' command requesting an .ahk target.
Thanks.
You are using outdated version of AutoHotkey which is more than 5 years old. Always use AutoHotkey and its documenatation from http://ahkscript.org/ (current uptodate version, new official website)! AutoHotkey and its documentation from autohotkey.com is outdated and you may have some problems using them!
One thing to try if you only have this problem on win 8 is to Enable interaction with administrative programs http://www.autohotkey.com/board/topic/70449-enable-interaction-with-administrative-programs/
That script modifies the executable file's embedded manifest, then creates and installs a self-signed certificate and uses it to sign the file. The executable will not run on any other system, unless you install the certificate used to sign the file.
But lets see some script code that way we have something to test with and can better help you out...

Installing JavaComm API on Ubuntu

I know this question has been asked several times around the internet, but I have spent about a week trying to solve this problem with little luck.
I am trying to install JavaCommAPI (an archived Java package to allow communication with rs232) on a remote linux Ubuntu 11.0, 32-bit server in order to deploy a web project which I have developed on a local apache server on my windows PC.
The thing that puzzles me is, I am able to get the .war web project to deploy on a local apache server on a separate 32-bit LinuxMint16 PC by correctly placing the javax.comm.properties, comm.jar, and libSerialParallel.so files in their respective places.
I use System.getProperty("java.library.path"); in order to find the correct library path in order to install correct files.
On my LinuxMint16:
javax.comm.properties -- /usr/lib/jvm/java-7-openjdk-i386/jre/lib
comm.jar -- /usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext
libSerialParallel.so -- /usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386
....works!
On my remote Ubuntu server I did the exact same for its reported library path
(for example: /usr/local/jdk/jdk1.7.0_45/jre/lib/javax.comm.properties ;
/usr/local/jdk/jdk1.7.0_45/jre/lib/ext/comm.jar ;
/usr/local/jdk/jdk1.7.0_45/jre/lib/i386/libSerialParallel.so)
...fails =(
Things of note: I added the needed apache jars and comm.jar to my libraries in Eclipse using the BuildPath wizard (right click on project --> Build Path-->add external jars) which points to local files on my PC which I obviously cannot use for a remote server which I am only accessing through command line. May this is affecting it somehow?
I tried to get error output (System.err) from the Java Console printed to a separate file for my remote server as that feedback was very helpful in getting all the files sorted on my LinuxMint PC.
PrintStream ps = new PrintStream(pathName);
System.setOut(ps);
System.setErr(ps);
Which again, is oddly working beautifully to print the stream to a local .txt file on my LinuxMintPC but not to the one I designate on my remote ubuntu server.
I am really at a wits end here!! Am I mixing and matching appropriate versions of Systems prohibiting things to run smoothly? I am not sure how to proceed from here, if anyone has any insights I would die of happiness. Thanks
I needed to install OPEN JDK7 on my ubuntu, put files in appropriate library paths (as described above) and now it works.

Automated builds in monotouch

I am currently trying to implement a one-click build solution (without having to start the monodevelop IDE) for my monotouch projects, where i could specify provisioning profiles and code signing certificates. I searched popular build tools like nant, ant and maven, but none seems to support monotouch. Has anyone tried something similar ?
I've gotten it work with Jenkins (aka Hudson).
You basically setup a Jenkins server, and setup your Mac as a "slave" build server. (I used a JNLP slave).
From there you can run any command line you want in the build, so you merely have to run mdtool with some arguments, like so:
/Applications/MonoDevelop.app/Contents/MacOS/mdtool -v build "--configuration:Release|iPhone" "Path/To/YourSolution.sln"
One thing to worry about is that to sign an iOS app, the slave process must run under your user. So you can't really create a Mac daemon for it, you'll have to run the slave process in startup for your user and minimize it, which is kind of annoying.
You tried teamcity? Might be worth you having a look at this thread Buildserver for MonoTouch upon OS X?
Thx for your answers. However i don't need to use such heavy artillery in this case. Since i'm developping a single and small app, I ended up by creating 3 different Build configurations in my solution, because i found out that it is possible to configure different codesign identities and provisioning profiles for each one (Development, Ad-Hoc, AppleStore), in the monodevelop project options menu.
Then in the AppleStore/Ad-Hoc configuration, i added post build commands, so i could create the .ipa file automatically (basically create a "Payload" folder and copy the .app file into it, and then zip it into a .ipa file, along with the icon and itunesartwork files).
Finally i created a bash script that invokes mdtool with any of the configurations, so i can build and generate .ipa executables by just executing the script.

Resources