Skip to content

terminated modern session cause trouble for subsequent session #5730

@anbj

Description

@anbj

Please see code below. Short summary:

  • a modern mode session is initiated, w. file download
  • "Oh no, I don't have enough bandwidth for this" -> ^C
  • session is terminated, leaving waste in .gmt/sessions/ causing trouble for subsequent session.

Should there not be a trap for e.g. ^C which triggers cleanup?

$ ls -l .gmt/sessions/
total 0

#make plot - I want @earth_relief_10m
$ gmt grdimage @earth_relief_10m -JM15c -RNO -pdf map
grdimage [NOTICE]: Remote data courtesy of GMT data server oceania [http://oceania.generic-mapping-tools.org]

grdimage [NOTICE]: Earth Relief at 10x10 arc minutes from Gaussian Cartesian filtering (18 km fullwidth) of SRTM15+V2.1 [Tozer et al., 2019].
grdimage [NOTICE]:   -> Download grid file [3.0M]: earth_relief_10m_p.grd
^C

#^ no way I'm downloading 3.0M! ^C it is.

#use @earth_relief_05m instead, which I already have downloaded
$ gmt grdimage @earth_relief_05m -JM15c -RNO -pdf map
gmt [ERROR]: Cannot run a one-liner modern command within an existing modern mode session

#what?!

#it's the terminated session causing trouble
$ ls .gmt/sessions/
gmt_session.337778

#delete it
$ gmt clear sessions

#works
$ gmt grdimage @earth_relief_05m -JM15c -RNO -pdf map

Tested with bleeding edge.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfeature requestRequest a new feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions