Search code examples
google-cloud-platformgcloudgoogle-cloud-sdkgoogle-cloud-shell

Google Cloud Shell gcloud commands output not pretty printed anymore


I was using GCloud Shell a few weeks ago and got pretty printed outputs from gcloud commands, like so:

DISPLAY NAME                            EMAIL                                                 DISABLED
Compute Engine default service account  [email protected]    False
sa-xxxxxxxxx                            [email protected]       False

Since a few days, output is not anymore pretty printed:

DISPLAY NAME: Compute Engine default service account
EMAIL: [email protected]
DISABLED: False

DISPLAY NAME: sa-xxxxxxxxx
EMAIL: [email protected]
DISABLED: False

I checked embedded gcloud SDK version:

$ gcloud -v
Google Cloud SDK 360.0.0
alpha 2021.10.04
app-engine-go 1.9.71
app-engine-java 1.9.91
app-engine-python 1.9.95
app-engine-python-extras 1.9.95
beta 2021.10.04
bigtable
bq 2.0.71
cbt 0.10.1
cloud-build-local 0.5.2
cloud-datastore-emulator 2.1.0
core 2021.10.04
datalab 20190610
gsutil 5.3
kind 0.7.0
kpt 1.0.0-beta.5
local-extract 1.3.1
minikube 1.23.2
pubsub-emulator 0.5.0
skaffold 1.32.0

I also checked the documentation on output formats, which isn’t of any help. Tried several outputs without being able to have a pretty one like before.

I tried installing the SDK 360.0.0 on Cloud Shell, which gives me the pretty output as before…

Anyone else having this issue? Or knowing how to get the pretty print as before (without having to manually install gcloud SDK)?

Edit:

As asked by John Hanley, here is the output of gcloud config list:

[accessibility]
screen_reader = True
[component_manager]
disable_update_check = True
[compute]
gce_metadata_read_timeout_sec = 30
[core]
account = [email protected]
disable_usage_reporting = True
project = my-project
[metrics]
environment = devshell

Your active configuration is: [cloudshell-25102]

Column width as given by tput cols is 267.


Solution

  • Thanks to @JohnHanley for the insight of gcloud config list, I compared the configurations between embedded gcloud and the downloaded version, then read some documentation to find that this behavior is only due to an accessibility option which is now set to true by default.

    For anyone having this issue, here is the command to get the good ol' pretty print output back:

    gcloud config set accessibility/screen_reader false
    

    If you want it to persist between Cloud Shell reboots, add the --installation flag and use sudo.