ledger icon indicating copy to clipboard operation
ledger copied to clipboard

Strange/Truncated output of payee on some locations

Open kmpm opened this issue 4 weeks ago • 2 comments

I get some inconsistent and strange output using the attached ledger file. When looking in register format it looks like this

.\bin\ledger.exe -f ledger.txt reg
2025/01/01 esme really lon Assets:Bank:Peter                   660.00     660.00
2025/01/01 esme really lon Equity:Opening Balances            -660.00       0.00
2025/11/26 Bus ticket      Assets:Bank:Peter                   259.00     259.00
2025/11/26 Bus ticket      Income:Sales                       -259.00       0.00

It shows esme really lon instead of Some really long text

Export shows similar behaviour

.\bin\ledger.exe -f ledger.txt export
2025/01/01,esme really long text,Assets:Bank:Peter,660.00
2025/01/01,esme really long text,Equity:Opening Balances,-660.00
2025/11/26,Bus ticket,Assets:Bank:Peter,259.00
2025/11/26,Bus ticket,Income:Sales,-259.00

In web it shows as esme really long text

Version info.

.\bin\ledger.exe version
ledger 1.16.6
go      go1.24.4
path    github.com/howeyc/ledger/ledger
mod     github.com/howeyc/ledger        v1.16.6+dirty
dep     github.com/alfredxing/calc      v0.0.0-20180827002445-77daf576f976      h1:+jyVKPjl5Y39thM0ZlVrRqKjSO/Upr5tP9ZQGELv8gw=
dep     github.com/andybalholm/brotli   v1.0.6  h1:Yf9fFpf49Zrxb9NlQaluyE92/+X7UVHlhMNJN2sxfOI=
dep     github.com/fatih/color  v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
dep     github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b      h1:wDUNC2eKiL35DbLvsDhiblTUXHxcOPwQSCzi7xpQUN4=
dep     github.com/inconshreveable/mousetrap    v1.1.0  h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
dep     github.com/ivanpirog/coloredcobra       v1.0.1  h1:aURSdEmlR90/tSiWS0dMjdwOvCVUeYLfltLfbgNxrN4=
dep     github.com/jbrukh/bayesian      v0.0.0-20200318221351-d726b684ca4a      h1:gbdjhSslIoRRiSSLCP3kKuLmqAJGmhnPVhIyf6Dbw34=
dep     github.com/joyt/godate  v0.0.0-20150226210126-7151572574a7      h1:2wH5antjhmU3EuWyidm0lJ4B9hGMpl5lNRo+M9uGJ5A=
dep     github.com/juztin/numeronym     v0.0.0-20160223091026-859fcc2918e2      h1:jrs0oyU9XY7MlTHbNxecqFgY+fgEENZdP4Z8FZln/pw=
dep     github.com/lucasb-eyer/go-colorful      v1.2.0  h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
dep     github.com/mattn/go-colorable   v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
dep     github.com/mattn/go-isatty      v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
dep     github.com/patrickmn/go-cache   v2.1.0+incompatible     h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
dep     github.com/pelletier/go-toml    v1.9.5  h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
dep     github.com/spf13/cobra  v1.7.0  h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
dep     github.com/spf13/pflag  v1.0.5  h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
dep     golang.org/x/sys        v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
dep     golang.org/x/term       v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
dep     golang.org/x/time       v0.3.0  h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
build   -buildmode=exe
build   -compiler=gc
build   -ldflags="-s -w -X github.com/howeyc/ledger/ledger/cmd.version=1.16.6"
build   DefaultGODEBUG=asynctimerchan=1,gotestjsonbuildtext=1,gotypesalias=0,httpservecontentkeepheaders=1,multipathtcp=0,randseednop=0,rsa1024min=0,tls3des=1,tlsmlkem=0,winreadlinkvolume=0,winsymlink=0,x509keypairleaf=0,x509negativeserial=1,x509rsacrt=0,x509usepolicies=0
build   CGO_ENABLED=0
build   GOARCH=amd64
build   GOOS=windows
build   GOAMD64=v1
build   vcs=git
build   vcs.revision=d4ef9637833ed9061eadfaafb7ac7267665c0e7f
build   vcs.time=2025-11-10T14:47:15Z
build   vcs.modified=true

ledger.txt

kmpm avatar Dec 04 '25 15:12 kmpm

By default the register command outputs to a fixed width of 80. Payee and account name are truncated if they would cause the printed line to exceed that width. You can use '--wide' flag to use terminal width. Truncation could still occur though.

howeyc avatar Dec 04 '25 18:12 howeyc

Having a "narrow" layout for CLI is OK even though I don't get why i the truncated text is prefixed with es. And why does it truncate in the web UI?

kmpm avatar Dec 05 '25 08:12 kmpm