经过一些命令终端不允许写

时间:2019-03-04 09:47:10

标签: postgresql ubuntu terminal psql pager

我从教程中学习,通常当他们在终端中键入命令并按Enter时,便会执行操作,并且他们可以键入下一条命令。我经常卡在这些屏幕上(通常使用ctlr + c可以帮助,但在下面的图片中则没有)。

image

import React from 'react'; import { Text, View, StyleSheet, Button } from 'react-native'; export default class App extends React.Component { state = { box11: 'Box 11', box12: 'Box 12', box13: 'Box 13', box21: 'Box 21', box22: 'Box 22', box23: 'Box 23', box31: 'Box 31', box32: 'Box 32', box33: 'Box 33' } getExactPos = (e, key) => { const { width, height, x, y } = e.nativeEvent.layout; let position = {}; position.gridXstart = x; position.gridXend = x + width; position.gridYstart = y; position.gridYend = y + height; this.setState({ [key]: position }); } getExactPosRow = (e, key) => { const { y } = e.nativeEvent.layout; this.setState({ [key]: y }); }; constructViews = () => { let rows = []; for (let i = 1; i < 4; i++) { let row = []; for (let j = 1; j < 4; j++) { let stateKey = `${i}${j}`; let styleKey = `box${stateKey}`; row.push( <View onLayout={ (e) => this.getExactPos(e, stateKey)} style={styles[styleKey]} key={stateKey}><Text>{this.state[styleKey]}</Text></View> ); } rows.push( <View onLayout={e => this.getExactPosRow(e, `${i}`)} style={styles[`row${i}`]} key={i}>{row}</View> ); } return rows; } render () { return ( <View style={{ justifyContent: 'center', alignItems: 'center', flex: 1 }}> <View style={{ flex: 1 }}></View> <Button onPress={() => console.log(this.state)} title={'console log state'} /> <View style={{ flex: 4, backgroundColor: 'red', marginLeft: 20, marginRight: 20 }} > {this.constructViews()} </View> <View style={{ flex: 1 }}></View> </View> ); } } const styles = StyleSheet.create({ row1: { flexDirection: 'row', flex: 1, backgroundColor: 'red', width: '100%' }, row2: { flexDirection: 'row', flex: 1, backgroundColor: 'blue', width: '100%' }, row3: { flexDirection: 'row', flex: 1, backgroundColor: 'green', width: '100%' }, box11: { flex: 1, backgroundColor: 'yellow', justifyContent: 'center', alignItems: 'center' }, box12: { flex: 1, backgroundColor: 'orange', justifyContent: 'center', alignItems: 'center' }, box13: { flex: 1, backgroundColor: 'gray', justifyContent: 'center', alignItems: 'center' }, box21: { flex: 1, backgroundColor: 'green', justifyContent: 'center', alignItems: 'center' }, box22: { flex: 1, backgroundColor: 'red', justifyContent: 'center', alignItems: 'center' }, box23: { flex: 1, backgroundColor: 'blue', justifyContent: 'center', alignItems: 'center' }, box31: { flex: 1, backgroundColor: 'purple', justifyContent: 'center', alignItems: 'center' }, box32: { flex: 1, backgroundColor: 'skyblue', justifyContent: 'center', alignItems: 'center' }, box33: { flex: 1, backgroundColor: '#124567', justifyContent: 'center', alignItems: 'center' } }); \l之类的命令可以做到这一点。

任何人都可以解释为什么教程中的人没有这些东西以及如何退出这些东西吗?

1 个答案:

答案 0 :(得分:0)

这似乎使您“陷入”了寻呼机less中。尝试键入q返回到psql提示符。

只要结果集对于屏幕来说太长或太宽,psql都会调用已配置的寻呼机对结果集进行分页。

您可以通过以下方式禁用此功能

\pset pager off

psql提示符下或您的~/.psqlrc文件中。