Is there a way to permanently turn off ANSI for Composer? - shell

When I run Composer in my shell, it renders all of the text with a background color of dark yellow, so that it is almost impossible to read.
There's an option to supply the --no-ansi argument with every command I run, but this really seems like a pain. Is there a way to turn it off of the default? Or even change the color to something more readable?

Just to give a real answer to this question, because I still have the requirement to call composer with --no-ansi (on a Windows server), because of such output in Putty via SSH:
You can edit the batch file of composer:
C:\ProgramData\ComposerSetup\bin\composer.bat
(edit its content)
php "%~dp0composer.phar" %* --no-ansi
Source: https://github.com/symfony/symfony/issues/19520#issuecomment-242627544

So it turns out that it was because I was using an "old" version of Composer. When I tried to run an install, I was getting the
Warning: This development build of composer is over 30 days old. It is
recommended to update it by running "/usr/local/bin/composer self-update"
to get the latest version.
I ran self-update, and it saw that there hadn't even been a new version in the last 30 days, but it is now rendering in a readable color scheme.

Related

Git Bash in windows won´t start

I´m really new using Git Bash so sorry in advance if my description is a little rough.
I was trying to use python inside Git Bash for windows so i followed this instructions: https://www.youtube.com/watch?v=M33oOq-c60s&t=2s&ab_channel=chinamatt
When I closed and try to re-open Git,it loaded for a few seconds and closed, without any error message,
Now I can´t make it load even unistalling and re- installing it, the only thing I notice is that at the top of the window it says usr/bin/bash --login i..
I guess it had to do with the '. ${HOME}/.bash_profile' ~ /.bashrc command, but I have no idea since
I´ve had never used {HOME} command before.
First, make sure your git bash works again, by removing any ~/.bahs_profile and ~/.bashrc
Second, consider, if you are on the latest Windows 10, to use WSL2, in which you will be able to install/use Python in a familiar Linux environment, as opposed to Git limited mingw/bash.

Need working config for TigerVNC on Fedora 30

I am been fighting with TigerVNC since around Fedora 17. Every time I started it manually I would get a black screen that would eventually display the gnome desktop and if I started with systemctl it would not work at all.
Recently wiped my system and installed Fedora 30. Same black screen when I manually start vncserver, but now it never displays the gnome desktop.
These are all default installs. I get no errors to accompany the black screens. I am at a loss of what to do. Could someone provide a working xstartup, config, and command line vncserver command so that I can hopefully get this working?
I had the same issue today after a fresh Fedora 30 install.
But, my home directory is from an older install so I'm using my old ~/.vnc directory and ~/.Xclients file.
I got it working by doing the following two things:
sudo echo "DESKTOP=GNOME" > /etc/sysconfig/desktop
Start vncserver manually as yourself. If you are already running a desktop on your system then you will have to use a different display number, so the command would be something like "vncserver :2".

Invisible text in terminal with yarn

I have a bug with Yarn and terminal (on Windows 10). When I use yarn add, yarn start etc then the first several lines are invisible and empty space appears.
For example, I have test.js with console.log('Hi console').
When I use yarn start (screen 1).
When I use npm start.js - it's ok. And then If I use yarn start - it's ok too. (screen 2).
But using 'yarn' standalone - making this bug.
Also I tried reset. Did not help.
So, it is March 2020 and I encountered this problem with Yarn 1.22.1, running VS Code Insiders on Windows 10. The OP's screenshots above show the problem, with the version of Yarn printed, followed by rows of empty space before returning to the prompt after apparently ignoring the command.
According to vscode issue #72145, "This is a bug in Windows 10 1809, unfortunately we have no way to work around the issue so you will need to wait until you get the next version of Windows 10 (1903)" ("Tyriar", April 11, 2019).
The fix the terminal in VS Code for me was to upgrade to Yarn v.2, which was just released in January 2020.
Yarn 2 has a lot of differences to Yarn 1, however, so you would want to read the Yarn 2 Migration docs before deciding if upgrading is the best course of action for your project. The chunk of empty space still appeared after upgrading, but was followed by the correct output in response to the Yarn commands.
Before upgrading to Yarn 2, if you don't want to do that yet, the workaround was to open the Windows 10 Command Prompt, cd into the project directory, and run the Yarn commands from that CLI. Using the Windows CLI correctly showed the correct output to Yarn commands where Git Bash did not.
Hope this might help someone.

Composer executes without any output

I'm running composer on Mac OS Yosemite. It worked well but suddenly I got no output at all (including any error).
For an example, when I run:
composer --version
terminal executes that without any output. No error as well. It happens with all composer command options. I did Google search but without relevant results.
Any idea?
Found a reason. Timezone must be set in php.in (date.timezone = UTC). I'm not sure what update caused composer to stop working, but that has solved a problem).

Timezone with symfony 2

I've got some troubles whith Symfony 2, trying to generate schema via :
php console/app generate:schema:create
I've got a pretty error :
[Exception]
DateTime::__construct(): It is not safe to rely on the system's
timezone settings. You are *required* to use the date.timezone
setting or the date_default_timezone_set() function.
In case you used any of those methods and you are still
getting this warning, you most likely misspelled the timezone
identifier.
We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
Thus, I'm trying to change the timezone in my php.ini with
date.timezone = 'Europe/Paris'
but even if I'm reloading my apache, I still get
date.timezone Europe/Zurich Europe/Zurich
if I look at my phpinfo(), so I don't really know what should I try next ... And I'm not even sure that I'm in the good way.
Thanks for helping me
On mac, if you have /etc/php.ini.default, do
sudo cp /etc/php.ini.default /etc/php.ini
and then do
php --ini
to see that it now loads a php.ini file.
this that trick
and se /etc/php5/cli/php.ini and /etc/php5/apache2/php.ini
datetime = 'America/Lima' for example
and run command
$ sudo apt-get install php5-sqlite
$ sudo /etc/init.d/apache2 restart
Some third-party distributions of PHP (including MAMP) have hard-coded the timezone. For instance, MAMP 2.0 is hard-coded to Europe/Berlin, and there is no way to change this. Even changing the value in the php.ini template has no effect, because MAMP overwrites your value. Are you using PHP from source, a pre-compiled package, or PHP as a part of some kind of LAMP stack?
If you are on debian based, you must modify the parameter in the file /etc/php5/cli/php.ini, changing it in /etc/php5/apache2/php.ini has no effect.
I know this is an old ticket, but since I was having a problem with this too, and it's still open I thought I'd share my quick 'n' dirty solution:
In my case, date.default was not set at all and I wasn't in a position to change php.ini. So, as a stopgap I added date_default_timezone_set('Europe/Dublin') at the start of web/app.php to change the timezone at runtime, which worked nicely for me.
If you're using the console to run any commands you will probably have to add the call to the the top of this script also.
I ran into this problem with my shared host. they told me I couldn't change time zones via php.ini, but you can try an .htaccess file instead.
create the .htaccess in the folder where Symfony is installed and put the following code in it:
SetEnv TZ America/Sao_Paulo
hope this helps.
cheers,
Luciano
For Windows, I installed XAMPP for the webserver and downloaded PHP and installed it so that I could run the symfony commands from command prompt.
In this case, the php.ini file used when I execute a Symfony command is located in C:\Program Files(x86)\PHP\php.ini. You have to have admin rights in order to edit this file, so I launched Notepad++ as administrator and opened the file.
Look for date.timezone and modify it according to your timezone e.g. date.timezone = Africa/Nairobi. Timezones are listed on the php website, just search php, timezones. No need to restart your computer or webserver.
I just encountered this problem with XAMPP on Mac 10.11.5, PHP 5.6.8
My error read "Warning: date_default_timezone_get(): Invalid date.timezone value 'America/Los Angeles',"
I fixed it by finding the only problem was the missing underscore in the "Los Angeles" entry for my PHP.ini date.timezone setting.
Try to execute this command:
sudo ln -s /usr/local/php5/lib/php.ini /etc/php.ini
Mac in my case.
First - config path, second - don't change.

Resources