Extracting small targets from complex backgrounds is the eventual goal of single infrared small target detection (SISTD), which has many potential applications in defense security and marine rescue. Recently, methods utilizing deep learning have shown their superiority over traditional theoretical approaches. However, they do not consider both the global semantics and specific shape information, thereby limiting their performance. To overcome this proplem, we propose a Gated Shaped TransUnet (GSTUnet), designed to fully utilize shape information while detecting small target detection. Specifically, we have proposed a multi-scale encoder branch to extract global features of small targets at different scales. Then, the extracted global features are passed through a gated-shaped stream branch that focuses on the shape information of small targets through gate convolutions. Finally, we fuse there features to obtain the final result. Our GSTUnet learns both global and shape information through the aforementioned two branches, establishing global relationships between different feature scales. The GSTUnet demonstrates excellent evaluation metrics on various datasets, outperforming current state-of-the-art methods. To access our code and datasets, please visit the following link: https://github.com/